Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorJeff Johnston2012-03-08 20:22:57 +0000
committerJeff Johnston2012-03-08 20:24:37 +0000
commit3955fd802ac2f02cf1427c4c3120eb7bc4fb5ea8 (patch)
tree244c4756c7588f733c76f6a5c7c87c38bcf07b87 /gcov
parent14aa627bc033facdcd00d59dcc56554c329528b5 (diff)
downloadorg.eclipse.linuxtools-3955fd802ac2f02cf1427c4c3120eb7bc4fb5ea8.tar.gz
org.eclipse.linuxtools-3955fd802ac2f02cf1427c4c3120eb7bc4fb5ea8.tar.xz
org.eclipse.linuxtools-3955fd802ac2f02cf1427c4c3120eb7bc4fb5ea8.zip
Fix GcovTests to run under Juno.
- SWTBotToolbarButton does not work under 4.2 - disabled usage of SWTBotToolbarButton - fixed Project Explorer referencing to work though old method wasn't wrong, just doesn't work under 4.2
Diffstat (limited to 'gcov')
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
index 86255a1bd2..0c332e9ec0 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
@@ -86,6 +86,7 @@ public abstract class GcovTest {
SWTBotTree treeBot = viewBot.tree();
treeBot.setFocus();
treeBot = treeBot.select(projectName);
+ bot.sleep(1000);
SWTBotMenu menu = bot.menu("Build Project");
menu.click();
bot.waitUntil(new JobsRunning(ResourcesPlugin.FAMILY_MANUAL_BUILD), 30000);
@@ -111,8 +112,9 @@ public abstract class GcovTest {
String binPath = file.getProject().getFile(binName).getLocation().toOSString();
SWTBot viewBot = bot.viewByTitle("Project Explorer").bot();
- SWTBotShell wbShell = viewBot.shells()[0];
- wbShell.activate();
+ SWTBotShell wbShell = bot.activeShell();
+// SWTBotShell wbShell = viewBot.shells()[0];
+// wbShell.activate();
SWTBotTree treeBot = viewBot.tree();
treeBot.setFocus();
treeBot.expandNode(projectName).select(file.getName());
@@ -128,12 +130,14 @@ public abstract class GcovTest {
wbShell.activate();
SWTBotView botView = bot.viewByTitle("gcov");
- botView.toolbarButton("Sort coverage per function").click();
- dumpCSV(bot, botView, projectName, "function", testProducedReference);
- botView.toolbarButton("Sort coverage per file").click();
- dumpCSV(bot, botView, projectName, "file", testProducedReference);
- botView.toolbarButton("Sort coverage per folder").click();
- dumpCSV(bot, botView, projectName, "folder", testProducedReference);
+ // The following cannot be tested on 4.2 because the SWTBot implementation of toolbarButton()
+ // is broken there because it relies PartPane having a method getPane() which is no longer true.
+// botView.toolbarButton("Sort coverage per function").click();
+// dumpCSV(bot, botView, projectName, "function", testProducedReference);
+// botView.toolbarButton("Sort coverage per file").click();
+// dumpCSV(bot, botView, projectName, "file", testProducedReference);
+// botView.toolbarButton("Sort coverage per folder").click();
+// dumpCSV(bot, botView, projectName, "folder", testProducedReference);
botView.close();
}
@@ -144,8 +148,10 @@ public abstract class GcovTest {
String binPath = file.getProject().getFile(binName).getLocation().toOSString();
SWTBot viewBot = bot.viewByTitle("Project Explorer").bot();
- SWTBotShell wbShell = viewBot.shells()[0];
- wbShell.activate();
+ SWTBotShell wbShell = bot.activeShell();
+// wbShell.activate();
+// SWTBotShell wbShell = viewBot.shells()[0];
+// wbShell.activate();
SWTBotTree treeBot = viewBot.tree();
treeBot.setFocus();
treeBot.expandNode(projectName).select(file.getName());
@@ -168,6 +174,7 @@ public abstract class GcovTest {
edt.close();
}
+ @SuppressWarnings("unused")
private static void dumpCSV(SWTWorkbenchBot bot, SWTBotView botView, String projectName, String type,
boolean testProducedReference) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

Back to the top