Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: test/mac/gyptest-xcode-gcc.py

Issue 83113002: Fix gyptest-xcode-gcc.py when using Xcode 5.0.2 (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/gyptest-xcode-gcc.py
diff --git a/test/mac/gyptest-xcode-gcc.py b/test/mac/gyptest-xcode-gcc.py
index abd884897d527c668d0165bd1690df7ab78408f2..3082b9dcdc6bfb39ca07eb3e1da3d49e8a90bca8 100644
--- a/test/mac/gyptest-xcode-gcc.py
+++ b/test/mac/gyptest-xcode-gcc.py
@@ -11,11 +11,28 @@ Verifies that xcode-style GCC_... settings are handled properly.
import TestGyp
import os
+import subprocess
import sys
def IgnoreOutput(string, expected_string):
return True
+def CompilerVersion(compiler):
+ stdout = subprocess.check_output([compiler, '-v'], stderr=subprocess.STDOUT)
+ return stdout.rstrip('\n')
+
+def CompilerSupportsWarnAboutInvalidOffsetOfMacro(test):
+ # With Xcode 5.0.2, gcc is a version of clang using different binary and
+ # include directories. It then behaves like clang and doesn't warn on
+ # invalid offsetofs (it silently ignore -Wno-invalid-offsetof).
+ if 'clang' in CompilerVersion('/usr/bin/gcc'):
+ return False
+ # TODO(thakis): This isn't really the right way to detect the compiler,
+ # Xcode has some embedded compiler, but it's a reliable proxy at least on
+ # the bots. The compiler is forced to gcc/g++ in the gyp file in a
+ # make_global_settings section for ninja and make.
+ return test.format != 'xcode' or os.readlink('/usr/bin/cc') != 'clang'
Mark Mentovai 2013/12/06 20:17:56 I think that testing |'clang' in CompilerVersion('
sdefresne 2013/12/10 12:38:43 Done.
+
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
@@ -30,11 +47,7 @@ if sys.platform == 'darwin':
# clang doesn't warn on invalid offsetofs, it silently ignores
# -Wno-invalid-offsetof.
- # TODO(thakis): This isn't really the right way to detect the compiler,
- # Xcode has some embedded compiler, but it's a reliable proxy at least on
- # the bots. The compiler is forced to gcc/g++ in the gyp file in a
- # make_global_settings section for ninja and make.
- if test.format != 'xcode' or os.readlink('/usr/bin/cc') != 'clang':
+ if CompilerSupportsWarnAboutInvalidOffsetOfMacro(test):
targets.append('warn_about_invalid_offsetof_macro')
for target in targets:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698