Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Camelon2004-02-27 15:59:47 +0000
committerJohn Camelon2004-02-27 15:59:47 +0000
commitd6a96dd12e37864ef8492b6358f796ff59bc7075 (patch)
tree53263365674aee22c19e4426c3fd803d0d105d90 /core/org.eclipse.cdt.core.tests/build
parent440660c80b8818b4c1878b984c041374f004f511 (diff)
downloadorg.eclipse.cdt-d6a96dd12e37864ef8492b6358f796ff59bc7075.tar.gz
org.eclipse.cdt-d6a96dd12e37864ef8492b6358f796ff59bc7075.tar.xz
org.eclipse.cdt-d6a96dd12e37864ef8492b6358f796ff59bc7075.zip
Patch for Sean Evoy
Tool inheritance test.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/build')
-rw-r--r--core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
index aabbc82118e..41bcb4cd9a5 100644
--- a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
+++ b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
@@ -895,6 +895,19 @@ public class ManagedBuildTests extends TestCase {
* @param testSubSub
*/
private void checkSubSubTarget(ITarget target) {
+ final String indyToolName = "Target Independent Tool";
+ final String indyToolCommand = "RC.EXE";
+ final String indyToolInputExt = "rc";
+ final String indyToolOutputExt = "free";
+ final String indyToolOutFlag = "/fo";
+ final String indyToolHeader = "h";
+ final String indyToolHeaderNot = "j";
+ final String indyCatOne = "Free";
+ final String indyCatTwo = "Chained";
+ final String freeOptName = "String in Free";
+ final String chainedOptName = "Boolean in Chained";
+ final String freeOptValue = "Live free or die";
+
// Check the inherited clean command
assertEquals("rm -yourworld", target.getCleanCommand());
// Check that the make command is overridden from parent
@@ -904,6 +917,53 @@ public class ManagedBuildTests extends TestCase {
// Make sure the list is inherited
String[] expectedOSList = {"win32","linux","solaris"};
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
+
+ // Get the 4 configurations
+ IConfiguration[] configs = target.getConfigurations();
+ assertEquals(4, configs.length);
+
+ // Check the tools. We should have 3 (1 from each parent and the one referenced).
+ ITool[] tools = target.getTools();
+ assertEquals(3, tools.length);
+ // 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);
+ // Check out the referenced tool and make sure we get all option categories
+ IOptionCategory topCategory = tools[2].getTopOptionCategory();
+ IOptionCategory[] categories = topCategory.getChildCategories();
+ assertEquals(1, categories.length);
+ assertEquals(categories[0].getName(), indyCatOne);
+ IOptionCategory[] subCategories = categories[0].getChildCategories();
+ // Is the chained category a subcategory
+ assertEquals(1, subCategories.length);
+ assertEquals(subCategories[0].getName(), indyCatTwo);
+ // Make sure the option in the top category is correct
+ IOption[] optsInCat = categories[0].getOptions(null);
+ assertEquals(1, optsInCat.length);
+ assertEquals(freeOptName, optsInCat[0].getName());
+ assertEquals(IOption.STRING, optsInCat[0].getValueType());
+ try {
+ assertEquals(freeOptValue, optsInCat[0].getStringValue());
+ } catch (BuildException e1) {
+ fail("Failed getting string value in subsubtarget :" + e1.getLocalizedMessage());
+ }
+
+ // Do the same for the options in the child cat
+ IOption[] optsInSubCat = subCategories[0].getOptions(null);
+ assertEquals(1, optsInSubCat.length);
+ assertEquals(chainedOptName, optsInSubCat[0].getName());
+ assertEquals(IOption.BOOLEAN, optsInSubCat[0].getValueType());
+ try {
+ assertFalse(optsInSubCat[0].getBooleanValue());
+ } catch (BuildException e) {
+ fail("Failure getting boolean value in subsubtarget: " + e.getLocalizedMessage());
+ }
}
/*

Back to the top