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

Unified Diff: test/mac/gyptest-archs.py

Issue 74103002: ninja: When the installed Xcode is Xcode 5 or later, use ['x86_64'] as the default value of ARCHS (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 | « pylib/gyp/xcode_emulation.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/gyptest-archs.py
===================================================================
--- test/mac/gyptest-archs.py (revision 1785)
+++ test/mac/gyptest-archs.py (working copy)
@@ -17,21 +17,35 @@
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
- def CheckFileType(file, expected):
- proc = subprocess.Popen(['file', '-b', file], stdout=subprocess.PIPE)
+ def GetStdout(cmdlist):
+ proc = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
o = proc.communicate()[0].strip()
assert not proc.returncode
+ return o
+
+ def CheckFileType(file, expected):
+ o = GetStdout(['file', '-b', file])
if not re.match(expected, o, re.DOTALL):
print 'File: Expected %s, got %s' % (expected, o)
test.fail_test()
+ def XcodeVersion():
+ xcode, build = GetStdout(['xcodebuild', '-version']).splitlines()
+ xcode = xcode.split()[-1].replace('.', '')
+ xcode = (xcode + '0' * (3 - len(xcode))).zfill(4)
+ return xcode
+
test.run_gyp('test-no-archs.gyp', chdir='archs')
test.build('test-no-archs.gyp', test.ALL, chdir='archs')
result_file = test.built_file_path('Test', chdir='archs')
test.must_exist(result_file)
- # FIXME: The default setting changed from i386 to x86_64 in Xcode 5.
- #CheckFileType(result_file, '^Mach-O executable i386')
+ if XcodeVersion() >= '0500':
+ expected_type = '^Mach-O 64-bit executable x86_64$'
+ else:
+ expected_type = '^Mach-O executable i386$'
+ CheckFileType(result_file, expected_type)
+
test.run_gyp('test-archs-x86_64.gyp', chdir='archs')
test.build('test-archs-x86_64.gyp', test.ALL, chdir='archs')
result_file = test.built_file_path('Test64', chdir='archs')
« no previous file with comments | « pylib/gyp/xcode_emulation.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698