1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

Fix for bugzilla 71134 -- Managed Make: String list command outputs null

This commit is contained in:
Sean Evoy 2004-08-16 20:41:16 +00:00
parent ae9f0a0e9a
commit b516c01e02
4 changed files with 23 additions and 3 deletions

View file

@ -282,6 +282,14 @@
builtIn="false">
</listOptionValue>
</option>
<option
valueType="stringList"
name="No Command StringList"
id="sub.tool.string.list">
<listOptionValue value="x"/>
<listOptionValue value="y"/>
<listOptionValue value="z"/>
</option>
</tool>
</target>
<target

View file

@ -1232,6 +1232,8 @@ public class ManagedBuildCoreTests extends TestCase {
* in the sub target, the test does a sanity check just to be complete.
*/
private void checkSubTarget(ITarget target) throws BuildException {
final String expectedFlags = "-I/usr/include -I/opt/gnome/include -IC:\\home\\tester/include -I\"../includes\" x y z";
// Check the overridden clean command
assertEquals("rm -yourworld", target.getCleanCommand());
// Make sure the target inherits the make command
@ -1259,7 +1261,7 @@ public class ManagedBuildCoreTests extends TestCase {
assertEquals("Sub Tool", subTool.getName());
// Confirm that it has four options
IOption[] subOpts = subTool.getOptions();
assertEquals(4, subOpts.length);
assertEquals(5, subOpts.length);
assertEquals("", subTool.getOutputFlag());
assertTrue(subTool.buildsFileType("yarf"));
assertTrue(subTool.producesFileType("bus"));
@ -1311,6 +1313,14 @@ public class ManagedBuildCoreTests extends TestCase {
assertEquals("obj1.o", objs[0]);
assertEquals("obj2.o", objs[1]);
assertEquals(IOption.BROWSE_FILE, subOpts[3].getBrowseType());
assertNull(subOpts[3].getCommand());
// There should be a string list with no command
assertEquals("No Command StringList", subOpts[4].getName());
assertEquals(IOption.STRING_LIST, subOpts[4].getValueType());
// Make sure the tool flags look right
assertEquals(subTool.getToolFlags(), expectedFlags);
// Get the configs for this target; it should inherit all the configs defined for the parent
IConfiguration[] configs = target.getConfigurations();

View file

@ -275,7 +275,8 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
String[] list = option.getStringListValue();
for (int j = 0; j < list.length; j++) {
String temp = list[j];
buf.append(listCmd + temp + WHITE_SPACE);
if (listCmd != null) buf.append(listCmd);
buf.append(temp + WHITE_SPACE);
}
break;

View file

@ -461,7 +461,8 @@ public class ToolReference implements IToolReference {
String[] list = option.getStringListValue();
for (int j = 0; j < list.length; j++) {
String temp = list[j];
buf.append(cmd + temp + WHITE_SPACE);
if (cmd != null) buf.append(cmd);
buf.append(temp + WHITE_SPACE);
}
break;