diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
index 7926ed79cb8..1004a711232 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
@@ -16,36 +16,10 @@ package org.eclipse.cdt.core.build.managed;
public interface IOption extends IBuildObject {
// Type for the value of the option
- public static final int STRING = 0;
- public static final int STRING_LIST = 1;
-
- /**
- * Returns the tool defining this option.
- *
- * @return
- */
- public ITool getTool();
-
- /**
- * Returns the category for this option.
- *
- * @return
- */
- public IOptionCategory getCategory();
-
- /**
- * Returns the name of this option.
- *
- * @return
- */
- public String getName();
-
- /**
- * Get the type for the value of the option.
- *
- * @return
- */
- public int getValueType();
+ public static final int BOOLEAN = 0;
+ public static final int ENUMERATED = 1;
+ public static final int STRING = 2;
+ public static final int STRING_LIST = 3;
/**
* If this option is defined as an enumeration, this function returns
@@ -57,11 +31,42 @@ public interface IOption extends IBuildObject {
public String [] getApplicableValues();
/**
- * Returns the current value for this option if it is a String
+ * @return the value for a boolean option.
+ */
+ public boolean getBooleanValue() throws BuildException;
+
+ /**
+ * Returns the category for this option.
*
* @return
*/
- public String getStringValue() throws BuildException;
+ public IOptionCategory getCategory();
+
+ /**
+ * @return a String containing the actual command line option
+ * associated with the IOption
+ */
+ public String getCommand();
+
+ /**
+ * @return a String
containing the default value for the
+ * enumerated option.
+ */
+ public String getDefaultEnumName ();
+
+
+ /**
+ * @return String
containing the command associated with the
+ * enumeration name.
+ */
+ public String getEnumCommand (String name);
+
+ /**
+ * Returns the name of this option.
+ *
+ * @return
+ */
+ public String getName();
/**
* Returns the current value for this option if it is a List of Strings.
@@ -69,5 +74,25 @@ public interface IOption extends IBuildObject {
* @return
*/
public String [] getStringListValue() throws BuildException;
+
+ /**
+ * Returns the current value for this option if it is a String
+ *
+ * @return
+ */
+ public String getStringValue() throws BuildException;
+ /**
+ * Returns the tool defining this option.
+ *
+ * @return
+ */
+ public ITool getTool();
+
+ /**
+ * Get the type for the value of the option.
+ *
+ * @return
+ */
+ public int getValueType();
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
index ecb36ff2cc1..37abd958fd5 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
@@ -11,7 +11,9 @@
package org.eclipse.cdt.internal.core.build.managed;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IConfiguration;
@@ -27,10 +29,12 @@ public class Option extends BuildObject implements IOption {
private ITool tool;
private IOptionCategory category;
- private List enumValues;
private int valueType;
private Object value;
+ private Map enumCommands;
+ private String defaultEnumName;
+ private String command;
private static final String[] emptyStrings = new String[0];
@@ -55,25 +59,53 @@ public class Option extends BuildObject implements IOption {
if (categoryId != null)
setCategory(tool.getOptionCategory(categoryId));
+ // command
+ command = element.getAttribute("command");
+
// valueType
String valueTypeStr = element.getAttribute("valueType");
if (valueTypeStr == null || valueTypeStr.equals("string"))
valueType = IOption.STRING;
else if (valueTypeStr.equals("stringList"))
valueType = IOption.STRING_LIST;
+ else if (valueTypeStr.equals("boolean"))
+ valueType = IOption.BOOLEAN;
+ else
+ valueType = IOption.ENUMERATED;
// value
+ enumCommands = new HashMap();
switch (valueType) {
+ case IOption.BOOLEAN:
+ // Convert the string to a boolean
+ value = new Boolean(element.getAttribute("defaultValue"));
+ break;
case IOption.STRING:
- value = element.getAttribute("value");
+ // Just get the value out of the option directly
+ value = element.getAttribute("defaultValue");
+ break;
+ case IOption.ENUMERATED:
+ List enumList = new ArrayList();
+ IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ for (int i = 0; i < enumElements.length; ++i) {
+ String optName = enumElements[i].getAttribute("name");
+ String optCommand = enumElements[i].getAttribute("command");
+ enumList.add(optName);
+ enumCommands.put(optName, optCommand);
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ if (isDefault.booleanValue()) {
+ defaultEnumName = optName;
+ }
+ }
+ value = enumList;
break;
case IOption.STRING_LIST:
List valueList = new ArrayList();
- value = valueList;
IConfigurationElement[] valueElements = element.getChildren("optionValue");
for (int i = 0; i < valueElements.length; ++i) {
valueList.add(valueElements[i].getAttribute("value"));
}
+ value = valueList;
break;
}
}
@@ -82,11 +114,17 @@ public class Option extends BuildObject implements IOption {
* @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues()
*/
public String[] getApplicableValues() {
+ List enumValues = (List)value;
return enumValues != null
? (String[])enumValues.toArray(new String[enumValues.size()])
: emptyStrings;
}
+ public boolean getBooleanValue() {
+ Boolean bool = (Boolean) value;
+ return bool.booleanValue();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCategory()
*/
@@ -94,6 +132,27 @@ public class Option extends BuildObject implements IOption {
return category != null ? category : getTool().getTopOptionCategory();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
+ */
+ public String getCommand() {
+ return command;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
+ */
+ public String getDefaultEnumName() {
+ return defaultEnumName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
+ */
+ public String getEnumCommand(String name) {
+ return (String) enumCommands.get(name);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
@@ -125,6 +184,13 @@ public class Option extends BuildObject implements IOption {
return valueType;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
+ */
+ public void setCategory(IOptionCategory category) {
+ this.category = category;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setStringValue(org.eclipse.cdt.core.build.managed.IConfiguration, java.lang.String)
*/
@@ -163,11 +229,4 @@ public class Option extends BuildObject implements IOption {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
- */
- public void setCategory(IOptionCategory category) {
- this.category = category;
- }
-
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
index d02eb34e688..5c8b7443117 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
@@ -11,7 +11,10 @@
package org.eclipse.cdt.internal.core.build.managed;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+
import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IOption;
@@ -30,6 +33,9 @@ public class OptionReference implements IOption {
private IOption option;
private ToolReference owner;
private Object value;
+ private String defaultEnumName;
+ private String command;
+ private Map enumCommands;
/**
* Created internally.
@@ -57,9 +63,28 @@ public class OptionReference implements IOption {
owner.addOptionReference(this);
// value
+ enumCommands = new HashMap();
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
+ value = new Boolean(element.getAttribute("defaultValue"));
+ break;
case IOption.STRING:
- value = element.getAttribute("value");
+ value = element.getAttribute("defaultValue");
+ break;
+ case IOption.ENUMERATED:
+ List enumList = new ArrayList();
+ IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ for (int i = 0; i < enumElements.length; ++i) {
+ String optName = enumElements[i].getAttribute("name");
+ String optCommand = enumElements[i].getAttribute("command");
+ enumList.add(optName);
+ enumCommands.put(optName, optCommand);
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ if (isDefault.booleanValue()) {
+ defaultEnumName = optName;
+ }
+ }
+ value = enumList;
break;
case IOption.STRING_LIST:
List valueList = new ArrayList();
@@ -67,6 +92,7 @@ public class OptionReference implements IOption {
for (int i = 0; i < valueElements.length; ++i) {
valueList.add(valueElements[i].getAttribute("value"));
}
+ value = valueList;
break;
}
}
@@ -85,6 +111,7 @@ public class OptionReference implements IOption {
// value
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
case IOption.STRING:
value = element.getAttribute("value");
break;
@@ -94,6 +121,7 @@ public class OptionReference implements IOption {
for (int i = 0; i < nodes.getLength(); ++i) {
valueList.add(((Element)nodes.item(i)).getAttribute("value"));
}
+ value = valueList;
break;
}
@@ -110,16 +138,26 @@ public class OptionReference implements IOption {
// value
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
case IOption.STRING:
element.setAttribute("value", (String)value);
break;
case IOption.STRING_LIST:
- List valueList = (List)value;
- for (int i = 0; i < valueList.size(); ++i) {
+ List stringList = (List)value;
+ for (int i = 0; i < stringList.size(); ++i) {
Element valueElement = doc.createElement("optionValue");
- valueElement.setAttribute("value", (String)valueList.get(i));
+ valueElement.setAttribute("value", (String)stringList.get(i));
element.appendChild(valueElement);
}
+ break;
+ case IOption.ENUMERATED:
+ List enumList = (List)value;
+ for (int i = 0; i < enumList.size(); ++i) {
+ Element valueElement = doc.createElement("optionEnum");
+ valueElement.setAttribute("value", (String)enumList.get(i));
+ element.appendChild(valueElement);
+ }
+ break;
}
}
@@ -137,6 +175,42 @@ public class OptionReference implements IOption {
return option.getCategory();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
+ */
+ public String getCommand() {
+ return option.getCommand();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
+ */
+ public String getDefaultEnumName() {
+ if (value == null) {
+ return option.getDefaultEnumName();
+ } else {
+ return defaultEnumName;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
+ */
+ public String getEnumCommand(String name) {
+ if (value == null) {
+ return option.getEnumCommand(name);
+ } else {
+ return (String)enumCommands.get(name);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
+ */
+ public String getId() {
+ return option.getId();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
@@ -144,6 +218,21 @@ public class OptionReference implements IOption {
return option.getName();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getBooleanValue()
+ */
+ public boolean getBooleanValue() throws BuildException {
+ if (value == null){
+ return option.getBooleanValue();
+ }
+ else if (getValueType() == IOption.BOOLEAN) {
+ Boolean bool = (Boolean) value;
+ return bool.booleanValue();
+ } else {
+ throw new BuildException("bad value type");
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
@@ -186,13 +275,6 @@ public class OptionReference implements IOption {
return option.getValueType();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
- */
- public String getId() {
- return option.getId();
- }
-
public boolean references(IOption target) {
if (equals(target))
// we are the target
diff --git a/core/org.eclipse.cdt.core/plugin.properties b/core/org.eclipse.cdt.core/plugin.properties
index 13dfb7ed2e8..53b857f2830 100644
--- a/core/org.eclipse.cdt.core/plugin.properties
+++ b/core/org.eclipse.cdt.core/plugin.properties
@@ -14,3 +14,7 @@ ProcessList.name=Process List
makeproject.name=Make Project
genericmake.name=Generic Make
makebuildmodel.name=Make Builder
+
+ManagedBuildNature.name=Managed C/C++ Build Nature
+
+GeneratedMakefileCBuilder.name=Generated Makefile C/C++ Builder
diff --git a/core/org.eclipse.cdt.core/plugin.xml b/core/org.eclipse.cdt.core/plugin.xml
index 8615371cead..726c7d3555c 100644
--- a/core/org.eclipse.cdt.core/plugin.xml
+++ b/core/org.eclipse.cdt.core/plugin.xml
@@ -252,5 +252,29 @@
pattern="*.exe">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
index dc77d15fc5f..d45c972dde2 100644
--- a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
+++ b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
@@ -1,343 +1,397 @@
-
-
-
-
-
-
-
-
- [Enter description of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is the id of the option category for this option. The id can be the id of the tool which is also a category.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions and configurations. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is a UI property. If set to true, users should not be able to create project configurations targeted at this target.
-
-
-
-
-
-
- The id of a target that this tool inherits from.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [Enter the first release in which this extension point appears.]
-
-
-
-
-
-
-
-
- [Enter extension point usage example here.]
-
-
-
-
-
-
-
-
- [Enter API information here.]
-
-
-
-
-
-
-
-
- [Enter information about supplied implementation of this extension point.]
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Describes targets, configurations, and toolchains for the build system.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A unique identifier for the option.
+
+
+
+
+
+
+ A descriptive name for the option.
+
+
+
+
+
+
+ An option can be one of the following types; 'string' for catch-all entries for options that cannot be easily defined any other way, 'string list' for entries that consist of a list of values such as defined symbols or paths, 'boolean' for options that have two values, and 'enumerated' for options that are one-of a list of values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overridden value assigned to the option by the end user.
+
+
+
+
+
+
+ This is the id of the option category for this option. The id can be the id of the tool which is also a category.
+
+
+
+
+
+
+ Specifies the default value for the option if the 'value' field is blank. For enumerated options the optionEnums will be searched for the default. For string list options, all defined optionValues will be treated as defaults. For boolean values, specify truth using the string 'true'. All other strings will be treated as false.
+
+
+
+
+
+
+ An optional value that specifies the actual command that will be passed to the tool on the command line.
+
+
+
+
+
+
+
+
+
+ Defines a single value of an enumerated option.
+
+
+
+
+
+
+ Unique identifier for the option enumeration.
+
+
+
+
+
+
+ A descriptive name for the enumeration.
+
+
+
+
+
+
+ Flags this enumerated value as the default to apply to the option if the user has not changed the setting.
+
+
+
+
+
+
+ The command that the enumerated value translates to on the command line.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions and configurations. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is a UI property. If set to true, users should not be able to create project configurations targeted at this target.
+
+
+
+
+
+
+ The id of a target that this tool inherits from.
+
+
+
+
+
+
+
+
+
+ An optional, but useful, mechanism for grouping options together.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A value for defining individual elements of a string list option.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CDT 1.1
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ [Enter API information here.]
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java b/core/org.eclipse.cdt.ui.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
index ce22ea79206..09855b57cc4 100644
--- a/core/org.eclipse.cdt.ui.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
+++ b/core/org.eclipse.cdt.ui.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
@@ -172,27 +172,51 @@ public class AllBuildTests extends TestCase {
// Root Tool
ITool rootTool = tools[0];
assertEquals("Root Tool", rootTool.getName());
- // Options
+ // 4 Options are defined in the root tool
IOption[] options = rootTool.getOptions();
- assertEquals(2, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(4, options.length);
+ // First option is a 2-element list
+ assertEquals("List Option in Top", options[0].getName());
+ assertEquals(IOption.STRING_LIST, options[0].getValueType());
String[] valueList = options[0].getStringListValue();
+ assertEquals(2, valueList.length);
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
- assertEquals("Option in Category", options[1].getName());
- assertEquals("x", options[1].getStringValue());
+ assertEquals(options[0].getCommand(), "-L");
+ // Next option is a boolean in top
+ assertEquals("Boolean Option in Top", options[1].getName());
+ assertEquals(IOption.BOOLEAN, options[1].getValueType());
+ assertEquals(false, options[1].getBooleanValue());
+ assertEquals("-b", options[1].getCommand());
+ // Next option is a string category
+ assertEquals("String Option in Category", options[2].getName());
+ assertEquals(IOption.STRING, options[2].getValueType());
+ assertEquals("x", options[2].getStringValue());
+ // Final option is an enumerated
+ assertEquals("Enumerated Option in Category", options[3].getName());
+ assertEquals(IOption.ENUMERATED, options[3].getValueType());
+ assertEquals("Default Enum", options[3].getDefaultEnumName());
+ valueList = options[3].getApplicableValues();
+ assertEquals(2, valueList.length);
+ assertEquals("Default Enum", valueList[0]);
+ assertEquals("Another Enum", valueList[1]);
+ assertEquals("-e1", options[3].getEnumCommand(valueList[0]));
+ assertEquals("-e2", options[3].getEnumCommand(valueList[1]));
+
// Option Categories
IOptionCategory topCategory = rootTool.getTopOptionCategory();
assertEquals("Root Tool", topCategory.getName());
options = topCategory.getOptions(null);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
+ assertEquals("Boolean Option in Top", options[1].getName());
IOptionCategory[] categories = topCategory.getChildCategories();
assertEquals(1, categories.length);
assertEquals("Category", categories[0].getName());
options = categories[0].getOptions(null);
- assertEquals(1, options.length);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
+ assertEquals("Enumerated Option in Category", options[1].getName());
// Configs
IConfiguration[] configs = target.getConfigurations();
@@ -205,15 +229,18 @@ public class AllBuildTests extends TestCase {
assertEquals("Root Tool", tools[0].getName());
topCategory = tools[0].getTopOptionCategory();
options = topCategory.getOptions(configs[0]);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
valueList = options[0].getStringListValue();
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
+ assertEquals("Boolean Option in Top", options[1].getName());
categories = topCategory.getChildCategories();
options = categories[0].getOptions(configs[0]);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
assertEquals(oicValue, options[0].getStringValue());
+ assertEquals("Enumerated Option in Category", options[1].getName());
// Root Override Config
assertEquals("Root Override Config", configs[1].getName());
tools = configs[1].getTools();
@@ -222,15 +249,24 @@ public class AllBuildTests extends TestCase {
assertEquals("Root Tool", tools[0].getName());
topCategory = tools[0].getTopOptionCategory();
options = topCategory.getOptions(configs[1]);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
valueList = options[0].getStringListValue();
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
+ assertEquals("Boolean Option in Top", options[1].getName());
categories = topCategory.getChildCategories();
options = categories[0].getOptions(configs[1]);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
assertEquals("y", options[0].getStringValue());
+ assertEquals("Enumerated Option in Category", options[1].getName());
+ valueList = options[1].getApplicableValues();
+ assertEquals(2, valueList.length);
+ assertEquals("Default Enum", valueList[0]);
+ assertEquals("Another Enum", valueList[1]);
+ assertEquals("-e1", options[1].getEnumCommand(valueList[0]));
+ assertEquals("-e2", options[1].getEnumCommand(valueList[1]));
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/plugin.xml b/core/org.eclipse.cdt.ui.tests/plugin.xml
index 9a6b943315d..02f6f9e05e8 100644
--- a/core/org.eclipse.cdt.ui.tests/plugin.xml
+++ b/core/org.eclipse.cdt.ui.tests/plugin.xml
@@ -105,7 +105,8 @@
id="category">
+
+