|
|
|
Re: C tools test cases [message #459824 is a reply to message #457855] |
Sun, 02 August 2009 07:18 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
Looking at your email, I do not understand which of the steps is
failing, what is the expected behavior and what is actually happening.
--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
On 2/8/09 08:06, Jay Norwood wrote:
> Here are a couple of tests that I added for C with the mingw cdt tools
> installed. These are similar to your java examples... creating their
> stationery Hello World example as project C1, then running it and
> checking the output in the Console View. Note that the StyledText
> casting code is a little different. Your java examples were out of date,
> and I couldn't figure out an exact mapping, but I take it you just
> wanted to have the assert catch the problem if the StyledText cast was
> about to fail.
>
> @Test
> public void canCreateANewCProject() throws Exception {
> SWTBotPerspective clangPerspective = bot.perspectiveByLabel("C/C++");
> clangPerspective.activate();
> bot.menu("File").menu("New").menu("Project...").click();
>
> SWTBotShell shellProj = bot.shell("New Project");
> shellProj.activate();
> bot.waitUntil(shellIsActive("New Project"));
> bot.tree().expandNode("C").select().click().select("C Project").click();
> bot.button("Next >").click();
>
> SWTBotShell shellC = bot.shell("C Project");
> shellC.activate();
>
> bot.textWithLabel("Project name:").setText("C1");
> shellC.activate();
> bot.tree().expandNode("Executable").select("Hello World ANSI C
> Project").click();
> shellC.activate();
> bot.button("Finish").click();
> bot.sleep(5000);
> // FIXME: assert that the project is actually created, for later
> }
>
> @Test
> public void canExecuteCApplication() throws Exception {
> bot.viewByTitle("Project Explorer");
> bot.tree().expandNode("C1").expandNode("Debug").select();
> bot.menu("Run").menu("Run").click();
> bot.sleep(5000);
> bot.viewByTitle("Console").setFocus();
> Widget consoleViewComposite = bot.getFocusedWidget(); assertThat
> (consoleViewComposite,instanceOf(StyledText.class));
> StyledText console = (StyledText) consoleViewComposite;
> SWTBotStyledText styledText = new SWTBotStyledText(console);
>
> assertTextContains("Hello World", styledText);
> }
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03335 seconds