mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Fix for bugzilla 71134 -- Managed Make: String list command outputs null
This commit is contained in:
parent
ae9f0a0e9a
commit
b516c01e02
4 changed files with 23 additions and 3 deletions
|
@ -282,6 +282,14 @@
|
||||||
builtIn="false">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
|
<option
|
||||||
|
valueType="stringList"
|
||||||
|
name="No Command StringList"
|
||||||
|
id="sub.tool.string.list">
|
||||||
|
<listOptionValue value="x"/>
|
||||||
|
<listOptionValue value="y"/>
|
||||||
|
<listOptionValue value="z"/>
|
||||||
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
</target>
|
</target>
|
||||||
<target
|
<target
|
||||||
|
|
|
@ -1232,6 +1232,8 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
* in the sub target, the test does a sanity check just to be complete.
|
* in the sub target, the test does a sanity check just to be complete.
|
||||||
*/
|
*/
|
||||||
private void checkSubTarget(ITarget target) throws BuildException {
|
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
|
// Check the overridden clean command
|
||||||
assertEquals("rm -yourworld", target.getCleanCommand());
|
assertEquals("rm -yourworld", target.getCleanCommand());
|
||||||
// Make sure the target inherits the make command
|
// Make sure the target inherits the make command
|
||||||
|
@ -1259,7 +1261,7 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals("Sub Tool", subTool.getName());
|
assertEquals("Sub Tool", subTool.getName());
|
||||||
// Confirm that it has four options
|
// Confirm that it has four options
|
||||||
IOption[] subOpts = subTool.getOptions();
|
IOption[] subOpts = subTool.getOptions();
|
||||||
assertEquals(4, subOpts.length);
|
assertEquals(5, subOpts.length);
|
||||||
assertEquals("", subTool.getOutputFlag());
|
assertEquals("", subTool.getOutputFlag());
|
||||||
assertTrue(subTool.buildsFileType("yarf"));
|
assertTrue(subTool.buildsFileType("yarf"));
|
||||||
assertTrue(subTool.producesFileType("bus"));
|
assertTrue(subTool.producesFileType("bus"));
|
||||||
|
@ -1311,6 +1313,14 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals("obj1.o", objs[0]);
|
assertEquals("obj1.o", objs[0]);
|
||||||
assertEquals("obj2.o", objs[1]);
|
assertEquals("obj2.o", objs[1]);
|
||||||
assertEquals(IOption.BROWSE_FILE, subOpts[3].getBrowseType());
|
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
|
// Get the configs for this target; it should inherit all the configs defined for the parent
|
||||||
IConfiguration[] configs = target.getConfigurations();
|
IConfiguration[] configs = target.getConfigurations();
|
||||||
|
|
|
@ -275,7 +275,8 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
|
||||||
String[] list = option.getStringListValue();
|
String[] list = option.getStringListValue();
|
||||||
for (int j = 0; j < list.length; j++) {
|
for (int j = 0; j < list.length; j++) {
|
||||||
String temp = list[j];
|
String temp = list[j];
|
||||||
buf.append(listCmd + temp + WHITE_SPACE);
|
if (listCmd != null) buf.append(listCmd);
|
||||||
|
buf.append(temp + WHITE_SPACE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -461,7 +461,8 @@ public class ToolReference implements IToolReference {
|
||||||
String[] list = option.getStringListValue();
|
String[] list = option.getStringListValue();
|
||||||
for (int j = 0; j < list.length; j++) {
|
for (int j = 0; j < list.length; j++) {
|
||||||
String temp = list[j];
|
String temp = list[j];
|
||||||
buf.append(cmd + temp + WHITE_SPACE);
|
if (cmd != null) buf.append(cmd);
|
||||||
|
buf.append(temp + WHITE_SPACE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue