diff options
author | Xavier Raynaud | 2012-03-14 17:51:52 +0000 |
---|---|---|
committer | Xavier Raynaud | 2012-03-14 17:51:52 +0000 |
commit | dd2407790120f4896f89b44ae95e67947ad80df9 (patch) | |
tree | 4d438f1c6fb0822feb1c5eed2a528fb5bf0dbeda | |
parent | 08ae1193dc32e93254ec0a0b42b5dfd4347b7cd2 (diff) | |
download | org.eclipse.linuxtools-dd2407790120f4896f89b44ae95e67947ad80df9.tar.gz org.eclipse.linuxtools-dd2407790120f4896f89b44ae95e67947ad80df9.tar.xz org.eclipse.linuxtools-dd2407790120f4896f89b44ae95e67947ad80df9.zip |
backport fixes needed to have stable tests for gcov
3 files changed, 39 insertions, 3 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestC.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestC.java index 586b4561f5..4a20f44a71 100644 --- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestC.java +++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestC.java @@ -4,6 +4,7 @@ import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.junit.BeforeClass; import org.junit.Test; @@ -40,8 +41,19 @@ public class GcovTestC { } bot.perspectiveByLabel("C/C++").activate(); + bot.sleep(500); + for (SWTBotShell sh : bot.shells()) { + if (sh.getText().startsWith("C/C++")) { + sh.activate(); + bot.sleep(500); + break; + } + } + bot.captureScreenshot(PROJECT_NAME + ".beforeClass.2.jpg"); // Turn off automatic building by default - bot.menu("Window").menu("Preferences").click(); + SWTBotMenu windowsMenu = bot.menu("Window"); + windowsMenu.menu("Preferences").click(); + SWTBotShell shell = bot.shell("Preferences"); shell.activate(); bot.tree().expandNode("General").select("Workspace"); diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCLibrary.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCLibrary.java index cd0dc42d90..b1247f5029 100644 --- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCLibrary.java +++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCLibrary.java @@ -4,6 +4,7 @@ import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.junit.BeforeClass; import org.junit.Test; @@ -41,8 +42,19 @@ public class GcovTestCLibrary { } bot.perspectiveByLabel("C/C++").activate(); + bot.sleep(500); + for (SWTBotShell sh : bot.shells()) { + if (sh.getText().startsWith("C/C++")) { + sh.activate(); + bot.sleep(500); + break; + } + } + bot.captureScreenshot(PROJECT_NAME + ".beforeClass.2.jpg"); // Turn off automatic building by default - bot.menu("Window").menu("Preferences").click(); + SWTBotMenu windowsMenu = bot.menu("Window"); + windowsMenu.menu("Preferences").click(); + SWTBotShell shell = bot.shell("Preferences"); shell.activate(); bot.tree().expandNode("General").select("Workspace"); diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCPP.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCPP.java index b3e3f24ee7..71c19886c0 100644 --- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCPP.java +++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTestCPP.java @@ -4,6 +4,7 @@ import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.junit.BeforeClass; import org.junit.Test; @@ -40,8 +41,19 @@ public class GcovTestCPP { } bot.perspectiveByLabel("C/C++").activate(); + bot.sleep(500); + for (SWTBotShell sh : bot.shells()) { + if (sh.getText().startsWith("C/C++")) { + sh.activate(); + bot.sleep(500); + break; + } + } + bot.captureScreenshot(PROJECT_NAME + ".beforeClass.2.jpg"); // Turn off automatic building by default - bot.menu("Window").menu("Preferences").click(); + SWTBotMenu windowsMenu = bot.menu("Window"); + windowsMenu.menu("Preferences").click(); + SWTBotShell shell = bot.shell("Preferences"); shell.activate(); bot.tree().expandNode("General").select("Workspace"); |