Index: test/ios/gyptest-per-config-settings.py |
=================================================================== |
--- test/ios/gyptest-per-config-settings.py (revision 1750) |
+++ test/ios/gyptest-per-config-settings.py (working copy) |
@@ -8,6 +8,7 @@ |
Verifies that device and simulator bundles are built correctly. |
""" |
+import plistlib |
import TestGyp |
import subprocess |
import sys |
@@ -22,6 +23,17 @@ |
test.fail_test() |
+def CheckPlistvalue(plist, key, expected): |
+ if key not in plist: |
+ print '%s not set in plist' % key |
+ test.fail_test() |
+ return |
+ actual = plist[key] |
+ if actual != expected: |
+ print 'File: Expected %s, got %s for %s' % (expected, actual, key) |
+ test.fail_test() |
+ |
+ |
if sys.platform == 'darwin': |
# TODO(justincohen): Enable this in xcode too once ninja can codesign and bots |
# are configured with signing certs. |
@@ -35,9 +47,18 @@ |
result_file = test.built_file_path('Test App Gyp.bundle/Test App Gyp', |
chdir='app-bundle') |
test.must_exist(result_file) |
+ |
+ info_plist = test.built_file_path('Test App Gyp.bundle/Info.plist', |
+ chdir='app-bundle') |
+ plist = plistlib.readPlist(info_plist) |
Nico
2013/10/11 20:20:49
Is it possible to put this in a test that runs und
justincohen
2013/10/12 14:52:28
Done, although I had to disable device builds for
|
+ |
+ CheckPlistvalue(plist, 'UIDeviceFamily', [1, 2]) |
+ |
if configuration == 'Default-iphoneos': |
CheckFileType(result_file, 'armv7') |
+ CheckPlistvalue(plist, 'CFBundleSupportedPlatforms', ['iPhoneOS']) |
else: |
CheckFileType(result_file, 'i386') |
+ CheckPlistvalue(plist, 'CFBundleSupportedPlatforms', ['iPhoneSimulator']) |
test.pass_test() |