[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Tests for new feature C, "Set Tool Command for Project"
|
There are two updated tests in the managed
build component of the core tests; one to test the interface change IConfiguration
to set a tool command, and one to test that the command can be set directly
through the ToolReference.
Feature and tests have been tested on
Linux and Win32.
Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada
Index: ChangeLog
===================================================================
retrieving revision 1.200
diff -u -r1.200 ChangeLog
--- ChangeLog 1 Mar 2004 21:18:09 -0000 1.200
+++ ChangeLog 2 Mar 2004 15:28:04 -0000
@@ -1,3 +1,8 @@
+2004-03-02 Sean Evoy
+ Added tests to verify that the tool command canbe set through the
+ IConfiguration interface in the testConfigurations() method, and
+ through a ToolReference in the checkSubSubTarget() method.
+
2004-03-01 Andrew Niefer
created CompleteParseASTSymbolIteratorTest and added it to the ParserTestSuite
Index: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
===================================================================
retrieving revision 1.19
diff -u -r1.19 ManagedBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java 27 Feb 2004 15:59:47 -0000 1.19
+++ build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java 2 Mar 2004 15:28:05 -0000
@@ -290,9 +290,11 @@
*
*/
public void testConfigurations() throws CoreException, BuildException {
- String rootName = "Root Config";
- String overrideName = "Root Override Config";
- String completeOverrideName = "Complete Override Config";
+ final String rootName = "Root Config";
+ final String overrideName = "Root Override Config";
+ final String completeOverrideName = "Complete Override Config";
+ final String toolCmd = "doIt";
+ final String newCmd = "never";
// Open the test project
IProject project = createProject(projectName);
@@ -320,6 +322,11 @@
assertEquals(1, definedTools.length);
ITool rootTool = definedTools[0];
+ // Test changing its command
+ assertEquals(rootTool.getToolCommand(), toolCmd);
+ newConfig.setToolCommand(rootTool, newCmd);
+ assertEquals(rootTool.getToolCommand(), newCmd);
+
// Override options in the new configuration
IOptionCategory topCategory = rootTool.getTopOptionCategory();
assertEquals("Root Tool", topCategory.getName());
@@ -907,6 +914,7 @@
final String freeOptName = "String in Free";
final String chainedOptName = "Boolean in Chained";
final String freeOptValue = "Live free or die";
+ final String newCmd = "Let the Wookie win";
// Check the inherited clean command
assertEquals("rm -yourworld", target.getCleanCommand());
@@ -925,17 +933,22 @@
// Check the tools. We should have 3 (1 from each parent and the one referenced).
ITool[] tools = target.getTools();
assertEquals(3, tools.length);
+ ITool toolRef = tools[2];
+
+ // Make sure the 3rd tool is a tool reference
+ assertTrue(toolRef instanceof ToolReference);
+
// Make sure we get all the tool settings
- assertEquals(tools[2].getName(), indyToolName);
- assertEquals(tools[2].getToolCommand(), indyToolCommand);
- assertTrue(tools[2].buildsFileType(indyToolInputExt));
- assertEquals(tools[2].getOutputExtension(indyToolInputExt), indyToolOutputExt);
- assertEquals(tools[2].getOutputFlag(), indyToolOutFlag);
- assertTrue(tools[2].isHeaderFile(indyToolHeader));
- assertFalse(tools[2].isHeaderFile(indyToolHeaderNot));
- assertEquals(tools[2].getNatureFilter(), ITool.FILTER_BOTH);
+ assertEquals(toolRef.getName(), indyToolName);
+ assertEquals(toolRef.getToolCommand(), indyToolCommand);
+ assertTrue(toolRef.buildsFileType(indyToolInputExt));
+ assertEquals(toolRef.getOutputExtension(indyToolInputExt), indyToolOutputExt);
+ assertEquals(toolRef.getOutputFlag(), indyToolOutFlag);
+ assertTrue(toolRef.isHeaderFile(indyToolHeader));
+ assertFalse(toolRef.isHeaderFile(indyToolHeaderNot));
+ assertEquals(toolRef.getNatureFilter(), ITool.FILTER_BOTH);
// Check out the referenced tool and make sure we get all option categories
- IOptionCategory topCategory = tools[2].getTopOptionCategory();
+ IOptionCategory topCategory = toolRef.getTopOptionCategory();
IOptionCategory[] categories = topCategory.getChildCategories();
assertEquals(1, categories.length);
assertEquals(categories[0].getName(), indyCatOne);
@@ -964,6 +977,10 @@
} catch (BuildException e) {
fail("Failure getting boolean value in subsubtarget: " + e.getLocalizedMessage());
}
+
+ // Test that the tool command can be changed through the reference
+ ((ToolReference)toolRef).setToolCommand(newCmd);
+ assertEquals(toolRef.getToolCommand(), newCmd);
}
/*