Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-08 00:01:26 -0400
committerAndrew Gvozdev2012-05-08 00:03:48 -0400
commitd4d87ca4121a10fddcf5455fb595bb338ee95943 (patch)
tree98cc21b890d9b06e23d72e2b4a5c1480542665bc /build
parentcfff2b91fb67877bb03dce34fa50f68b732a61ec (diff)
downloadorg.eclipse.cdt-d4d87ca4121a10fddcf5455fb595bb338ee95943.tar.gz
org.eclipse.cdt-d4d87ca4121a10fddcf5455fb595bb338ee95943.tar.xz
org.eclipse.cdt-d4d87ca4121a10fddcf5455fb595bb338ee95943.zip
bug 378766: [Scanner discovery] GCC Build Output parser doesn't handle framework paths (-F)
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java45
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java2
2 files changed, 47 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
index 61d625ec00..022f671cd5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
@@ -574,6 +574,51 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
}
/**
+ * Parse Mac Frameworks.
+ */
+ public void testCIncludePathEntryFrameworks() throws Exception {
+ // Create model project and accompanied descriptions
+ String projectName = getName();
+ IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
+ ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
+ ICConfigurationDescription cfgDescription = cfgDescriptions[0];
+
+ IFile file=ResourceHelper.createFile(project, "file.cpp");
+ ICLanguageSetting ls = cfgDescription.getLanguageSettingForFile(file.getProjectRelativePath(), true);
+ String languageId = ls.getLanguageId();
+
+ // create GCCBuildCommandParser
+ GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager.getExtensionProviderCopy(GCC_BUILD_COMMAND_PARSER_EXT, true);
+
+ // parse line
+ parser.startup(cfgDescription, null);
+ parser.processLine("gcc"
+ // framework
+ + " -F/Framework "
+ // framework system
+ + " -iframework/framework/system "
+ // with spaces
+ + " -F '/Framework with spaces' "
+ + " file.cpp");
+ parser.shutdown();
+
+ // check populated entries
+ List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
+ {
+ IPath path = new Path("/Framework").setDevice(project.getLocation().getDevice());
+ assertEquals(new CIncludePathEntry(path, ICSettingEntry.FRAMEWORKS_MAC), entries.get(0));
+ }
+ {
+ IPath path = new Path("/framework/system").setDevice(project.getLocation().getDevice());
+ assertEquals(new CIncludePathEntry(path, ICSettingEntry.FRAMEWORKS_MAC), entries.get(1));
+ }
+ {
+ IPath path = new Path("/Framework with spaces").setDevice(project.getLocation().getDevice());
+ assertEquals(new CIncludePathEntry(path, ICSettingEntry.FRAMEWORKS_MAC), entries.get(2));
+ }
+ }
+
+ /**
* Parse variations of -D options.
*/
public void testCMacroEntry() throws Exception {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
index 93d0e20062..8f0d1021cc 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
@@ -26,6 +26,8 @@ public class GCCBuildCommandParser extends AbstractBuildCommandParser implements
static final AbstractOptionParser[] optionParsers = {
new IncludePathOptionParser("-I\\s*([\"'])(.*)\\1", "$2"),
new IncludePathOptionParser("-I\\s*([^\\s\"']*)", "$1"),
+ new IncludePathOptionParser("-(F|(iframework))\\s*([\"'])(.*)\\3", "$4", ICSettingEntry.FRAMEWORKS_MAC),
+ new IncludePathOptionParser("-(F|(iframework))\\s*([^\\s\"']*)", "$3", ICSettingEntry.FRAMEWORKS_MAC),
new IncludeFileOptionParser("-include\\s*([\"'])(.*)\\1", "$2"),
new IncludeFileOptionParser("-include\\s*([^\\s\"']*)", "$1"),
new MacroOptionParser("-D\\s*([\"'])([^=]*)(=(.*))?\\1", "$2", "$4"),

Back to the top