mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
swtbot: Wait for the presence of a text pattern in the console view
Instead of relying only on a sleep, wait until the specified console view has the specified text pattern. Change-Id: I196ac1f1c04212c536b9bd5917156f24158df469 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
parent
6744ecdeab
commit
5664514d00
4 changed files with 55 additions and 74 deletions
|
@ -20,6 +20,8 @@ import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IProjectNature;
|
import org.eclipse.core.resources.IProjectNature;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -38,6 +40,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.Widget;
|
import org.eclipse.swt.widgets.Widget;
|
||||||
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
|
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
|
||||||
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
|
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
|
||||||
|
import org.eclipse.swtbot.swt.finder.SWTBot;
|
||||||
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
|
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
|
||||||
import org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper;
|
import org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper;
|
||||||
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
|
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
|
||||||
|
@ -46,6 +49,7 @@ import org.eclipse.swtbot.swt.finder.results.VoidResult;
|
||||||
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
|
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
|
||||||
import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
||||||
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
|
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
|
||||||
|
import org.eclipse.swtbot.swt.finder.waits.ICondition;
|
||||||
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
|
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
|
||||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
|
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
|
||||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
|
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
|
||||||
|
@ -397,4 +401,37 @@ public abstract class AbstractTest {
|
||||||
bot.closeAllEditors();
|
bot.closeAllEditors();
|
||||||
mainShell.activate();
|
mainShell.activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected ICondition consoleTextMatches(SWTBotView consoleView, Pattern pattern) {
|
||||||
|
return new ConsoleTextMatches(consoleView, pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected class ConsoleTextMatches implements ICondition {
|
||||||
|
private final SWTBotView view;
|
||||||
|
private Pattern pattern;
|
||||||
|
|
||||||
|
public ConsoleTextMatches(SWTBotView view, Pattern pattern) {
|
||||||
|
this.view = view;
|
||||||
|
this.pattern = pattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean test() throws Exception {
|
||||||
|
if (view.isActive()) {
|
||||||
|
String output = view.bot().styledText().getText();
|
||||||
|
java.util.regex.Matcher m = pattern.matcher(output);
|
||||||
|
return m.matches();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(SWTBot bot) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFailureMessage() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,14 +107,10 @@ public class TestEnvironmentVars extends AbstractTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertTrue(f.exists());
|
assertTrue(f.exists());
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = viewConsole("Configure");
|
SWTBotView consoleView = viewConsole("Configure");
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
Pattern p = Pattern.compile(".*--enable-somevar.*", Pattern.DOTALL);
|
Pattern p = Pattern.compile(".*--enable-somevar.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
|
||||||
// We should see the expanded some_var variable in the console
|
// We should see the expanded some_var variable in the console
|
||||||
assertTrue(m.matches());
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
|
|
||||||
setEnvVarOnCommandLine();
|
setEnvVarOnCommandLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,15 +153,12 @@ public class TestEnvironmentVars extends AbstractTest {
|
||||||
clickContextMenu(projectExplorer.bot().tree().select(projectName),
|
clickContextMenu(projectExplorer.bot().tree().select(projectName),
|
||||||
"Reconfigure Project");
|
"Reconfigure Project");
|
||||||
focusMainShell();
|
focusMainShell();
|
||||||
bot.sleep(3000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
Pattern p = Pattern.compile(
|
Pattern p = Pattern.compile(
|
||||||
".*a boat.*a train.*car.*a wagon.*a plane.*skates.*",
|
".*a boat.*a train.*car.*a wagon.*a plane.*skates.*",
|
||||||
Pattern.DOTALL);
|
Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue(m.matches());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.autotools.ui.tests;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -63,13 +62,10 @@ public class TestMakeTargets extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.table().getTableItem("info").select();
|
bot.table().getTableItem("info").select();
|
||||||
bot.button("Build").click();
|
bot.button("Build").click();
|
||||||
bot.sleep(3000);
|
|
||||||
|
|
||||||
SWTBotView consoleView = viewConsole("CDT Build Console");
|
SWTBotView consoleView = viewConsole("CDT Build Console");
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
Pattern p = Pattern.compile(".*make info.*", Pattern.DOTALL);
|
Pattern p = Pattern.compile(".*make info.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue(m.matches());
|
|
||||||
|
|
||||||
// Make Targets using right-click on project.
|
// Make Targets using right-click on project.
|
||||||
clickProjectContextMenu("Make Targets", "Build...");
|
clickProjectContextMenu("Make Targets", "Build...");
|
||||||
|
@ -77,14 +73,11 @@ public class TestMakeTargets extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.table().getTableItem("check").select();
|
bot.table().getTableItem("check").select();
|
||||||
bot.button("Build").click();
|
bot.button("Build").click();
|
||||||
bot.sleep(3000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
p = Pattern.compile(".*make check.*Making check in src.*",
|
p = Pattern.compile(".*make check.*Making check in src.*",
|
||||||
Pattern.DOTALL);
|
Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue(m.matches());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.autotools.ui.tests;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
@ -67,12 +66,10 @@ public class TestToolActions extends AbstractTest {
|
||||||
bot.sleep(1000);
|
bot.sleep(1000);
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
||||||
+ ".*aclocal --help.*Usage: aclocal.*", Pattern.DOTALL);
|
+ ".*aclocal --help.*Usage: aclocal.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// Verify we still don't have an aclocal.m4 file yet
|
// Verify we still don't have an aclocal.m4 file yet
|
||||||
f = new File(path.toOSString());
|
f = new File(path.toOSString());
|
||||||
assertTrue(!f.exists());
|
assertTrue(!f.exists());
|
||||||
|
@ -82,14 +79,11 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell = bot.shell("Aclocal Options");
|
shell = bot.shell("Aclocal Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
||||||
+ ".*aclocal.*", Pattern.DOTALL);
|
+ ".*aclocal.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// We need to wait until the aclocal.m4 file is created so
|
// We need to wait until the aclocal.m4 file is created so
|
||||||
// sleep a bit and look for it...give up after 20 seconds
|
// sleep a bit and look for it...give up after 20 seconds
|
||||||
for (int i = 0; i < 40; ++i) {
|
for (int i = 0; i < 40; ++i) {
|
||||||
|
@ -114,15 +108,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
f.delete();
|
f.delete();
|
||||||
}
|
}
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Autoconf");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Autoconf");
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking autoconf in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking autoconf in.*" + projectName
|
||||||
+ ".*autoconf.*", Pattern.DOTALL);
|
+ ".*autoconf.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// We need to wait until the configure file is created so
|
// We need to wait until the configure file is created so
|
||||||
// sleep a bit and look for it...give up after 20 seconds
|
// sleep a bit and look for it...give up after 20 seconds
|
||||||
for (int i = 0; i < 40; ++i) {
|
for (int i = 0; i < 40; ++i) {
|
||||||
|
@ -142,14 +133,11 @@ public class TestToolActions extends AbstractTest {
|
||||||
clickVolatileContextMenu(
|
clickVolatileContextMenu(
|
||||||
projectExplorer.bot().tree().select("configure.ac"),
|
projectExplorer.bot().tree().select("configure.ac"),
|
||||||
"Invoke Autotools", "Invoke Autoconf");
|
"Invoke Autotools", "Invoke Autoconf");
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
p = Pattern.compile(".*Invoking autoconf in.*" + projectName
|
p = Pattern.compile(".*Invoking autoconf in.*" + projectName
|
||||||
+ ".*autoconf.*", Pattern.DOTALL);
|
+ ".*autoconf.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// We need to wait until the configure file is created so
|
// We need to wait until the configure file is created so
|
||||||
// sleep a bit and look for it...give up after 20 seconds
|
// sleep a bit and look for it...give up after 20 seconds
|
||||||
for (int i = 0; i < 40; ++i) {
|
for (int i = 0; i < 40; ++i) {
|
||||||
|
@ -186,15 +174,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking automake in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking automake in.*" + projectName
|
||||||
+ ".*automake --help.*Usage:.*", Pattern.DOTALL);
|
+ ".*automake --help.*Usage:.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// Verify we still don't have Makefile.in files yet
|
// Verify we still don't have Makefile.in files yet
|
||||||
f = new File(path.toOSString());
|
f = new File(path.toOSString());
|
||||||
assertTrue(!f.exists());
|
assertTrue(!f.exists());
|
||||||
|
@ -210,15 +195,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
// here
|
// here
|
||||||
bot.text(1).typeText("Makefile src/Makefile");
|
bot.text(1).typeText("Makefile src/Makefile");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(2000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
p = Pattern.compile(".*Invoking automake in.*" + projectName
|
p = Pattern.compile(".*Invoking automake in.*" + projectName
|
||||||
+ ".*automake --add-missing Makefile src/Makefile.*",
|
+ ".*automake --add-missing Makefile src/Makefile.*",
|
||||||
Pattern.DOTALL);
|
Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
// We need to wait until the Makefile.in files are created so
|
// We need to wait until the Makefile.in files are created so
|
||||||
// sleep a bit and look for it...give up after 20 seconds
|
// sleep a bit and look for it...give up after 20 seconds
|
||||||
for (int i = 0; i < 40; ++i) {
|
for (int i = 0; i < 40; ++i) {
|
||||||
|
@ -245,15 +227,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking libtoolize in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking libtoolize in.*" + projectName
|
||||||
+ ".*libtoolize --help.*Usage: libtoolize.*", Pattern.DOTALL);
|
+ ".*libtoolize --help.*Usage: libtoolize.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify we can access the libtoolize tool
|
// Verify we can access the libtoolize tool
|
||||||
|
@ -264,15 +243,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(2000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking autoheader in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking autoheader in.*" + projectName
|
||||||
+ ".*autoheader --help.*Usage:.*autoheader.*", Pattern.DOTALL);
|
+ ".*autoheader --help.*Usage:.*autoheader.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify we can access the autoreconf tool
|
// Verify we can access the autoreconf tool
|
||||||
|
@ -305,15 +281,12 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = bot.viewByPartName("Console");
|
SWTBotView consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking autoreconf in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking autoreconf in.*" + projectName
|
||||||
+ ".*autoreconf --help.*Usage: .*autoreconf.*", Pattern.DOTALL);
|
+ ".*autoreconf --help.*Usage: .*autoreconf.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Autoreconf");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Autoreconf");
|
||||||
shell = bot.shell("Autoreconf Options");
|
shell = bot.shell("Autoreconf Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
|
@ -454,75 +427,60 @@ public class TestToolActions extends AbstractTest {
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
SWTBotView consoleView = viewConsole("Autotools");
|
SWTBotView consoleView = viewConsole("Autotools");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
String output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
Pattern p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
Pattern p = Pattern.compile(".*Invoking aclocal in.*" + projectName
|
||||||
+ ".*automake --help.*Usage:.*automake.*", Pattern.DOTALL);
|
+ ".*automake --help.*Usage:.*automake.*", Pattern.DOTALL);
|
||||||
Matcher m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
|
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Automake");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Automake");
|
||||||
shell = bot.shell("Automake Options");
|
shell = bot.shell("Automake Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
p = Pattern.compile(".*Invoking automake in.*" + projectName
|
p = Pattern.compile(".*Invoking automake in.*" + projectName
|
||||||
+ ".*autoconf --help.*Usage:.*autoconf.*", Pattern.DOTALL);
|
+ ".*autoconf --help.*Usage:.*autoconf.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
|
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Autoheader");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Autoheader");
|
||||||
shell = bot.shell("Autoheader Options");
|
shell = bot.shell("Autoheader Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
p = Pattern.compile(".*Invoking autoheader in.*" + projectName
|
p = Pattern.compile(".*Invoking autoheader in.*" + projectName
|
||||||
+ ".*autoreconf --help.*Usage:.*autoreconf.*", Pattern.DOTALL);
|
+ ".*autoreconf --help.*Usage:.*autoreconf.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
|
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Autoreconf");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Autoreconf");
|
||||||
shell = bot.shell("Autoreconf Options");
|
shell = bot.shell("Autoreconf Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
p = Pattern.compile(".*Invoking autoreconf in.*" + projectName
|
p = Pattern.compile(".*Invoking autoreconf in.*" + projectName
|
||||||
+ ".*libtoolize --help.*Usage:.*libtoolize.*", Pattern.DOTALL);
|
+ ".*libtoolize --help.*Usage:.*libtoolize.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
|
|
||||||
clickProjectContextMenu("Invoke Autotools", "Invoke Libtoolize");
|
clickProjectContextMenu("Invoke Autotools", "Invoke Libtoolize");
|
||||||
shell = bot.shell("Libtoolize Options");
|
shell = bot.shell("Libtoolize Options");
|
||||||
shell.activate();
|
shell.activate();
|
||||||
bot.text(0).typeText("--help");
|
bot.text(0).typeText("--help");
|
||||||
bot.button("OK").click();
|
bot.button("OK").click();
|
||||||
bot.sleep(1000);
|
|
||||||
consoleView = bot.viewByPartName("Console");
|
consoleView = bot.viewByPartName("Console");
|
||||||
consoleView.setFocus();
|
consoleView.setFocus();
|
||||||
output = consoleView.bot().styledText().getText();
|
|
||||||
// Verify we got some help output to the console
|
// Verify we got some help output to the console
|
||||||
p = Pattern.compile(".*Invoking libtoolize in.*" + projectName
|
p = Pattern.compile(".*Invoking libtoolize in.*" + projectName
|
||||||
+ ".*aclocal --help.*Usage:.*aclocal.*", Pattern.DOTALL);
|
+ ".*aclocal --help.*Usage:.*aclocal.*", Pattern.DOTALL);
|
||||||
m = p.matcher(output);
|
bot.waitUntil(consoleTextMatches(consoleView, p));
|
||||||
assertTrue("Got: " + output, m.matches());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue