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 app bundles are built correctly. | 8 Verifies that app bundles are built correctly. |
9 """ | 9 """ |
10 | 10 |
11 import TestGyp | 11 import TestGyp |
12 | 12 |
13 import os | 13 import os |
14 import sys | 14 import sys |
15 | 15 |
16 | 16 |
17 def ls(path): | 17 def ls(path): |
18 '''Returns a list of all files in a directory, relative to the directory.''' | 18 '''Returns a list of all files in a directory, relative to the directory.''' |
19 result = [] | 19 result = [] |
20 for dirpath, _, files in os.walk(path): | 20 for dirpath, _, files in os.walk(path): |
21 for f in files: | 21 for f in files: |
22 result.append(os.path.join(dirpath, f)[len(path) + 1:]) | 22 result.append(os.path.join(dirpath, f)[len(path) + 1:]) |
23 return result | 23 return result |
24 | 24 |
25 | 25 |
26 if sys.platform == 'darwin': | 26 if sys.platform == 'darwin': |
27 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | 27 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
28 | 28 |
29 test.run_gyp('framework.gyp', chdir='framework') | 29 test.run_gyp('framework.gyp', |
| 30 '-G', 'xcode_ninja_target_pattern=^test_framework$', |
| 31 chdir='framework') |
30 | 32 |
31 test.build('framework.gyp', 'test_framework', chdir='framework') | 33 test.build('framework.gyp', 'test_framework', chdir='framework') |
32 | 34 |
33 # Binary | 35 # Binary |
34 test.built_file_must_exist( | 36 test.built_file_must_exist( |
35 'Test Framework.framework/Versions/A/Test Framework', | 37 'Test Framework.framework/Versions/A/Test Framework', |
36 chdir='framework') | 38 chdir='framework') |
37 | 39 |
38 # Info.plist | 40 # Info.plist |
39 info_plist = test.built_file_path( | 41 info_plist = test.built_file_path( |
(...skipping 25 matching lines...) Expand all Loading... |
65 chdir='framework'))) != \ | 67 chdir='framework'))) != \ |
66 set(['Versions/A/Test Framework', | 68 set(['Versions/A/Test Framework', |
67 'Versions/A/Resources/Info.plist', | 69 'Versions/A/Resources/Info.plist', |
68 'Versions/A/Resources/English.lproj/InfoPlist.strings', | 70 'Versions/A/Resources/English.lproj/InfoPlist.strings', |
69 'Test Framework', | 71 'Test Framework', |
70 'Versions/A/Libraries/empty.c', # Written by a gyp action. | 72 'Versions/A/Libraries/empty.c', # Written by a gyp action. |
71 ]): | 73 ]): |
72 test.fail_test() | 74 test.fail_test() |
73 | 75 |
74 test.pass_test() | 76 test.pass_test() |
OLD | NEW |