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 a postbuild copying a dependend framework into an app bundle is | 8 Verifies that a postbuild copying a dependend framework into an app bundle is |
9 rerun if the resources in the framework change. | 9 rerun if the resources in the framework change. |
10 """ | 10 """ |
11 | 11 |
12 import TestGyp | 12 import TestGyp |
13 | 13 |
14 import os.path | 14 import os.path |
15 import sys | 15 import sys |
16 | 16 |
17 if sys.platform == 'darwin': | 17 if sys.platform == 'darwin': |
18 # TODO(thakis): Make this pass with the make generator, http://crbug.com/95529 | 18 # TODO(thakis): Make this pass with the make generator, http://crbug.com/95529 |
19 test = TestGyp.TestGyp(formats=['ninja', 'xcode']) | 19 test = TestGyp.TestGyp(formats=['ninja', 'xcode']) |
20 | 20 |
21 CHDIR = 'postbuild-copy-bundle' | 21 CHDIR = 'postbuild-copy-bundle' |
22 test.run_gyp('test.gyp', chdir=CHDIR) | 22 test.run_gyp('test.gyp', chdir=CHDIR) |
23 | 23 |
24 app_bundle_dir = test.built_file_path('Test app.app', chdir=CHDIR) | 24 app_bundle_dir = test.built_file_path('Test App.app', chdir=CHDIR) |
25 bundled_framework_dir = os.path.join( | 25 bundled_framework_dir = os.path.join( |
26 app_bundle_dir, 'Contents', 'My Framework.framework', 'Resources') | 26 app_bundle_dir, 'Contents', 'My Framework.framework', 'Resources') |
27 final_plist_path = os.path.join(bundled_framework_dir, 'Info.plist') | 27 final_plist_path = os.path.join(bundled_framework_dir, 'Info.plist') |
28 final_resource_path = os.path.join(bundled_framework_dir, 'resource_file.sb') | 28 final_resource_path = os.path.join(bundled_framework_dir, 'resource_file.sb') |
29 final_copies_path = os.path.join( | 29 final_copies_path = os.path.join( |
30 app_bundle_dir, 'Contents', 'My Framework.framework', 'Versions', 'A', | 30 app_bundle_dir, 'Contents', 'My Framework.framework', 'Versions', 'A', |
31 'Libraries', 'copied.txt') | 31 'Libraries', 'copied.txt') |
32 | 32 |
33 # Check that the dependency was built and copied into the app bundle: | 33 # Check that the dependency was built and copied into the app bundle: |
34 test.build('test.gyp', 'test_app', chdir=CHDIR) | 34 test.build('test.gyp', 'test_app', chdir=CHDIR) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 test.sleep() | 66 test.sleep() |
67 contents = test.read('postbuild-copy-bundle/copied.txt') | 67 contents = test.read('postbuild-copy-bundle/copied.txt') |
68 contents = contents.replace('old', 'new') | 68 contents = contents.replace('old', 'new') |
69 test.write('postbuild-copy-bundle/copied.txt', contents) | 69 test.write('postbuild-copy-bundle/copied.txt', contents) |
70 test.build('test.gyp', 'test_app', chdir=CHDIR) | 70 test.build('test.gyp', 'test_app', chdir=CHDIR) |
71 | 71 |
72 test.must_exist(final_copies_path) | 72 test.must_exist(final_copies_path) |
73 test.must_contain(final_copies_path, 'new copied file') | 73 test.must_contain(final_copies_path, 'new copied file') |
74 | 74 |
75 test.pass_test() | 75 test.pass_test() |
OLD | NEW |