Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
index 3d6bfe896f1..c10b4405bec 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
@@ -84,6 +84,15 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
}
}
+ class MockLspToolchainBuiltinSpecsDetectorCommandResolver extends MockGCCBuiltinSpecsDetectorCommandResolver {
+ // ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
+ private static final String MOCK_TOOLCHAIN_ID = "cdt.managedbuilder.lsp.tests.toolchain";
+ @Override
+ public String getToolchainId() {
+ return MOCK_TOOLCHAIN_ID;
+ }
+ }
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -164,6 +173,19 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
}
/**
+ * Test expansion of relevant tool options in build command.
+ */
+ public void testGCCBuiltinSpecsDetector_ResolvedCommand_Flags() throws Exception {
+ // check ${FLAGS}
+ MockLspToolchainBuiltinSpecsDetectorCommandResolver detector = new MockLspToolchainBuiltinSpecsDetectorCommandResolver();
+ detector.setLanguageScope(new ArrayList<String>() {{add(LANGUAGE_ID_C);}});
+ detector.setCommand("gcc ${FLAGS}");
+
+ String resolvedCommand = detector.resolveCommand(LANGUAGE_ID_C);
+ assertEquals("gcc -bool-option -str-option=str-value -enum-option -list-option1 -list-option2 -tree-option", resolvedCommand);
+ }
+
+ /**
* Test parsing of macro without value.
*/
public void testGCCBuiltinSpecsDetector_Macro_NoValue() throws Exception {

Back to the top