OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies that ios app bundles are built correctly. | 8 Verifies that ios app bundles are built correctly. |
9 """ | 9 """ |
10 | 10 |
11 import TestGyp | 11 import TestGyp |
12 | 12 |
13 import subprocess | |
13 import sys | 14 import sys |
14 | 15 |
16 def CheckFileBinaryPropertyList(file): | |
17 output = subprocess.check_output(['file', file]) | |
18 if not 'Apple binary property list' in output: | |
19 print 'File: Expected Apple binary property list, got %s' % o | |
20 test.fail_test() | |
21 | |
15 if sys.platform == 'darwin': | 22 if sys.platform == 'darwin': |
16 test = TestGyp.TestGyp(formats=['xcode', 'ninja']) | 23 test = TestGyp.TestGyp(formats=['xcode', 'ninja']) |
17 | 24 |
18 test.run_gyp('test.gyp', chdir='app-bundle') | 25 test.run_gyp('test.gyp', chdir='app-bundle') |
19 | 26 |
20 test.build('test.gyp', test.ALL, chdir='app-bundle') | 27 test.build('test.gyp', test.ALL, chdir='app-bundle') |
21 | 28 |
22 # Test that the extension is .bundle | 29 # Test that the extension is .bundle |
23 test.built_file_must_exist('Test App Gyp.app/Test App Gyp', | 30 test.built_file_must_exist('Test App Gyp.app/Test App Gyp', |
24 chdir='app-bundle') | 31 chdir='app-bundle') |
25 | 32 |
26 # Info.plist | 33 # Info.plist |
27 info_plist = test.built_file_path('Test App Gyp.app/Info.plist', | 34 info_plist = test.built_file_path('Test App Gyp.app/Info.plist', |
28 chdir='app-bundle') | 35 chdir='app-bundle') |
36 test.built_file_must_exist(info_plist) | |
37 CheckFileBinaryPropertyList(info_plist) | |
38 | |
29 # Resources | 39 # Resources |
30 test.built_file_must_exist( | 40 strings_file = test.built_file_path( |
31 'Test App Gyp.app/English.lproj/InfoPlist.strings', | 41 'Test App Gyp.app/English.lproj/InfoPlist.strings', |
32 chdir='app-bundle') | 42 chdir='app-bundle') |
43 test.built_file_must_exist(strings_file) | |
44 CheckFileBinaryPropertyList(strings_file) | |
45 | |
33 test.built_file_must_exist( | 46 test.built_file_must_exist( |
34 'Test App Gyp.app/English.lproj/MainMenu.nib', | 47 'Test App Gyp.app/English.lproj/MainMenu.nib', |
35 chdir='app-bundle') | 48 chdir='app-bundle') |
36 test.built_file_must_exist( | 49 test.built_file_must_exist( |
37 'Test App Gyp.app/English.lproj/Main_iPhone.storyboardc', | 50 'Test App Gyp.app/English.lproj/Main_iPhone.storyboardc', |
38 chdir='app-bundle') | 51 chdir='app-bundle') |
39 | 52 |
40 # Packaging | 53 # Packaging |
41 test.built_file_must_exist('Test App Gyp.app/PkgInfo', | 54 test.built_file_must_exist('Test App Gyp.app/PkgInfo', |
42 chdir='app-bundle') | 55 chdir='app-bundle') |
43 test.built_file_must_match('Test App Gyp.app/PkgInfo', 'APPLause', | 56 test.built_file_must_match('Test App Gyp.app/PkgInfo', 'APPLause', |
44 chdir='app-bundle') | 57 chdir='app-bundle') |
45 | 58 |
46 test.pass_test() | 59 test.pass_test() |
Mark Mentovai
2015/03/09 13:11:22
You haven’t actually tested that the INFOPLIST_OUT
justincohen
2015/03/09 14:28:30
Added a test for desktop default, ios deafult, and
| |
OLD | NEW |