From cf55505f7b17c957f9d8057df13f21c31865b828 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sun, 10 Jul 2011 08:33:14 -0400 Subject: [PATCH] testAbstractBuiltinSpecsDetector_Launch() --- .../tests/GCCBuiltinSpecsDetectorTest.java | 31 ++++++++++++++++++- .../GCCBuiltinSpecsDetector.java | 9 ------ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/build/core/scannerconfig/tests/GCCBuiltinSpecsDetectorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/build/core/scannerconfig/tests/GCCBuiltinSpecsDetectorTest.java index 5e5ff994266..21d1a22c2b7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/build/core/scannerconfig/tests/GCCBuiltinSpecsDetectorTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/build/core/scannerconfig/tests/GCCBuiltinSpecsDetectorTest.java @@ -401,6 +401,35 @@ public class GCCBuiltinSpecsDetectorTest extends TestCase { } } + public void testAbstractBuiltinSpecsDetector_Launch() throws Exception { + // Create model project and accompanied descriptions + String projectName = getName(); + IProject project = ResourceHelper.createCDTProjectWithConfig(projectName); + ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project); + + ICConfigurationDescription cfgDescription = cfgDescriptions[0]; + + AbstractBuiltinSpecsDetector detector = new MockBuiltinSpecsDetector() { + @Override + public boolean processLine(String line) { + // pretending that we parsed the line + detectedSettingEntries.add(new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY)); + return true; + } + }; + detector.setLanguageScope(new ArrayList() {{add(LANGUAGE_ID);}}); + detector.setCustomParameter("echo #define MACRO VALUE"); + + detector.run(cfgDescription, LANGUAGE_ID, null, null, null); + + List noentries = detector.getSettingEntries(null, null, null); + assertNull(noentries); + + List entries = detector.getSettingEntries(cfgDescription, null, LANGUAGE_ID); + ICLanguageSettingEntry expected = new CMacroEntry("MACRO", "VALUE", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY); + assertEquals(expected, entries.get(0)); + } + public void testAbstractBuiltinSpecsDetector_GroupSettings() throws Exception { // define benchmarks final CIncludePathEntry includePath_1 = new CIncludePathEntry("/include/path_1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY); @@ -606,7 +635,7 @@ public class GCCBuiltinSpecsDetectorTest extends TestCase { detector.processLine(" "+loc+"/misplaced/include2"); detector.processLine("Framework search starts here:"); detector.processLine(" "+loc+"/System/Library/Frameworks"); - detector.processLine("End of search list."); + detector.processLine("End of framework search list."); detector.processLine(" "+loc+"/misplaced/include3"); detector.shutdown(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java index d5fee24780e..6b01c80d53b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/GCCBuiltinSpecsDetector.java @@ -63,15 +63,6 @@ public class GCCBuiltinSpecsDetector extends AbstractBuiltinSpecsDetector implem return makeList(line); } - /** - -Framework search starts here: - /System/Library/Frameworks - /Library/Frameworks -End of framework search list. - - */ - // contribution of includes if (line.equals("#include \"...\" search starts here:")) { state = State.EXPECTING_LOCAL_INCLUDE;