mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Committing to head for Leo Treggiari (missed part of the original patch from 5-July-2004)
This commit is contained in:
parent
53bb3add57
commit
39e2a667df
2 changed files with 27 additions and 10 deletions
|
@ -848,6 +848,7 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
String expectedCleanCmd = "del /myworld";
|
String expectedCleanCmd = "del /myworld";
|
||||||
String expectedParserId = "org.eclipse.cdt.core.PE";
|
String expectedParserId = "org.eclipse.cdt.core.PE";
|
||||||
String[] expectedOSList = {"win32"};
|
String[] expectedOSList = {"win32"};
|
||||||
|
String[] expectedArchList = {"all"};
|
||||||
assertTrue(target.isTestTarget());
|
assertTrue(target.isTestTarget());
|
||||||
if (target.getArtifactName().equals("ManagedBuildTest")) {
|
if (target.getArtifactName().equals("ManagedBuildTest")) {
|
||||||
assertEquals(target.getArtifactExtension(), newExt);
|
assertEquals(target.getArtifactExtension(), newExt);
|
||||||
|
@ -858,6 +859,7 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals("make", target.getMakeCommand());
|
assertEquals("make", target.getMakeCommand());
|
||||||
assertEquals(expectedParserId, target.getBinaryParserId());
|
assertEquals(expectedParserId, target.getBinaryParserId());
|
||||||
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
||||||
|
assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
|
||||||
// This target defines no errors parsers.
|
// This target defines no errors parsers.
|
||||||
assertNull(target.getErrorParserIds());
|
assertNull(target.getErrorParserIds());
|
||||||
assertTrue(Arrays.equals(target.getErrorParserList(), CCorePlugin.getDefault().getAllErrorParsersIDs()));
|
assertTrue(Arrays.equals(target.getErrorParserList(), CCorePlugin.getDefault().getAllErrorParsersIDs()));
|
||||||
|
@ -1096,9 +1098,12 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals("nmake", target.getMakeCommand());
|
assertEquals("nmake", target.getMakeCommand());
|
||||||
// Make sure we get the proper binary parser
|
// Make sure we get the proper binary parser
|
||||||
assertEquals("org.eclipse.cdt.core.ELF", target.getBinaryParserId());
|
assertEquals("org.eclipse.cdt.core.ELF", target.getBinaryParserId());
|
||||||
// Make sure the list is inherited
|
// Make sure the os list is inherited
|
||||||
String[] expectedOSList = {"win32","linux","solaris"};
|
String[] expectedOSList = {"win32","linux","solaris"};
|
||||||
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
||||||
|
// Make sure the arch list is inherited
|
||||||
|
String[] expectedArchList = {"x86", "ppc"};
|
||||||
|
assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
|
||||||
|
|
||||||
// Get the 5 configurations (3 from test, 1 from test sub and 1 from this)
|
// Get the 5 configurations (3 from test, 1 from test sub and 1 from this)
|
||||||
IConfiguration[] configs = target.getConfigurations();
|
IConfiguration[] configs = target.getConfigurations();
|
||||||
|
@ -1232,6 +1237,9 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals("org.eclipse.cdt.core.PE", target.getBinaryParserId());
|
assertEquals("org.eclipse.cdt.core.PE", target.getBinaryParserId());
|
||||||
String[] expectedOSList = {"win32","linux","solaris"};
|
String[] expectedOSList = {"win32","linux","solaris"};
|
||||||
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
|
||||||
|
// Make sure the list is overridden
|
||||||
|
String[] expectedArchList = {"x86", "ppc"};
|
||||||
|
assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
|
||||||
|
|
||||||
// Make sure this is a test target
|
// Make sure this is a test target
|
||||||
assertTrue(target.isTestTarget());
|
assertTrue(target.isTestTarget());
|
||||||
|
|
|
@ -112,26 +112,35 @@ public class Target extends BuildObject implements ITarget {
|
||||||
String os = element.getAttribute(OS_LIST);
|
String os = element.getAttribute(OS_LIST);
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
targetOSList = new ArrayList();
|
targetOSList = new ArrayList();
|
||||||
StringTokenizer tokens = new StringTokenizer(os, ","); //$NON-NLS-1$
|
String[] osTokens = os.split(","); //$NON-NLS-1$
|
||||||
while (tokens.hasMoreTokens()) {
|
for (int i = 0; i < osTokens.length; ++i) {
|
||||||
targetOSList.add(tokens.nextToken().trim());
|
targetOSList.add(osTokens[i].trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the comma-separated list of valid Architectures
|
||||||
|
String arch = element.getAttribute(ARCH_LIST);
|
||||||
|
if (arch != null) {
|
||||||
|
targetArchList = new ArrayList();
|
||||||
|
String[] archTokens = arch.split(","); //$NON-NLS-1$
|
||||||
|
for (int j = 0; j < archTokens.length; ++j) {
|
||||||
|
targetArchList.add(archTokens[j].trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
// Load any tool references we might have
|
// Load any tool references we might have
|
||||||
IManagedConfigElement[] toolRefs = element.getChildren(IConfiguration.TOOLREF_ELEMENT_NAME);
|
IManagedConfigElement[] toolRefs = element.getChildren(IConfiguration.TOOLREF_ELEMENT_NAME);
|
||||||
for (int i=0; i < toolRefs.length; ++i) {
|
for (int k = 0; k < toolRefs.length; ++k) {
|
||||||
new ToolReference(this, toolRefs[i]);
|
new ToolReference(this, toolRefs[k]);
|
||||||
}
|
}
|
||||||
// Then load any tools defined for the target
|
// Then load any tools defined for the target
|
||||||
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
|
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
|
||||||
for (int j = 0; j < tools.length; ++j) {
|
for (int m = 0; m < tools.length; ++m) {
|
||||||
new Tool(this, tools[j]);
|
new Tool(this, tools[m]);
|
||||||
}
|
}
|
||||||
// Then load the configurations which may have tool references
|
// Then load the configurations which may have tool references
|
||||||
IManagedConfigElement[] configs = element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);
|
IManagedConfigElement[] configs = element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);
|
||||||
for (int k = 0; k < configs.length; ++k) {
|
for (int n = 0; n < configs.length; ++n) {
|
||||||
new Configuration(this, configs[k]);
|
new Configuration(this, configs[n]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue