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

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

Issue 23781011: ninja/mac: Insert a few synthesized Info.plist entries. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 3 months 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 | « test/mac/app-bundle/TestApp/TestApp-Info.plist ('k') | test/mac/gyptest-sdkroot.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/gyptest-app.py
===================================================================
--- test/mac/gyptest-app.py (revision 1733)
+++ test/mac/gyptest-app.py (working copy)
@@ -11,9 +11,19 @@
import TestGyp
import os
+import plistlib
+import subprocess
import sys
+def GetStdout(cmdlist):
+ return subprocess.Popen(cmdlist,
+ stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
+def ExpectEq(expected, actual):
+ if expected != actual:
+ print >>sys.stderr, 'Expected "%s", got "%s"' % (expected, actual)
+ test.fail_test()
+
def ls(path):
'''Returns a list of all files in a directory, relative to the directory.'''
result = []
@@ -41,6 +51,25 @@
test.must_contain(info_plist, 'com.google.Test-App-Gyp') # Variable expansion
test.must_not_contain(info_plist, '${MACOSX_DEPLOYMENT_TARGET}');
+ if test.format != 'make':
+ # TODO: Synthesized plist entries aren't hooked up in the make generator.
+ plist = plistlib.readPlist(info_plist)
+ ExpectEq(GetStdout(['sw_vers', '-buildVersion']),
+ plist['BuildMachineOSBuild'])
+ ExpectEq('', plist['DTSDKName'])
+ sdkbuild = GetStdout(
+ ['xcodebuild', '-version', '-sdk', '', 'ProductBuildVersion'])
+ if not sdkbuild:
+ # Above command doesn't work in Xcode 4.2.
+ sdkbuild = plist['BuildMachineOSBuild']
+ ExpectEq(sdkbuild, plist['DTSDKBuild'])
+ xcode, build = GetStdout(['xcodebuild', '-version']).splitlines()
+ xcode = xcode.split()[-1].replace('.', '')
+ xcode = (xcode + '0' * (3 - len(xcode))).zfill(4)
+ build = build.split()[-1]
+ ExpectEq(xcode, plist['DTXcode'])
+ ExpectEq(build, plist['DTXcodeBuild'])
+
# Resources
strings_files = ['InfoPlist.strings', 'utf-16be.strings', 'utf-16le.strings']
for f in strings_files:
« no previous file with comments | « test/mac/app-bundle/TestApp/TestApp-Info.plist ('k') | test/mac/gyptest-sdkroot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698