Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSean Evoy2004-08-16 16:41:16 -0400
committerSean Evoy2004-08-16 16:41:16 -0400
commitb516c01e02daaab846686f1ea7a9abdc611ab4de (patch)
treebe65c1acbf447469911cbeba5596115b844d5352 /build
parentae9f0a0e9a132f4dc2b2e114e4aa02da72fc557b (diff)
downloadorg.eclipse.cdt-b516c01e02daaab846686f1ea7a9abdc611ab4de.tar.gz
org.eclipse.cdt-b516c01e02daaab846686f1ea7a9abdc611ab4de.tar.xz
org.eclipse.cdt-b516c01e02daaab846686f1ea7a9abdc611ab4de.zip
Fix for bugzilla 71134 -- Managed Make: String list command outputs null
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java3
4 files changed, 23 insertions, 3 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
index 2b33c5bac39..d06a3d86224 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
@@ -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
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
index 0e81ec2c223..9772909426a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
@@ -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();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
index 56046f6519a..313f5df2ac4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
@@ -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;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index 6bd4bcaddf0..a551ffb7ae6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -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;

Back to the top