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

Side by Side Diff: test/mac/gyptest-postbuild-copy-bundle.py

Issue 11362051: ninja/mac: Let copies sections that copy stuff inside a bundle mark the bundle as dirty. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/mac/postbuild-copy-bundle/copied.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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(
30 app_bundle_dir, 'Contents', 'My Framework.framework', 'Versions', 'A',
31 'Libraries', 'copied.txt')
29 32
30 # 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:
31 test.build('test.gyp', 'test_app', chdir=CHDIR) 34 test.build('test.gyp', 'test_app', chdir=CHDIR)
32 test.must_exist(final_resource_path) 35 test.must_exist(final_resource_path)
33 test.must_match(final_resource_path, 36 test.must_match(final_resource_path,
34 'This is included in the framework bundle.\n') 37 'This is included in the framework bundle.\n')
35 38
36 test.must_exist(final_plist_path) 39 test.must_exist(final_plist_path)
37 test.must_contain(final_plist_path, '''\ 40 test.must_contain(final_plist_path, '''\
38 \t<key>RandomKey</key> 41 \t<key>RandomKey</key>
(...skipping 13 matching lines...) Expand all
52 contents = test.read('postbuild-copy-bundle/Framework-Info.plist') 55 contents = test.read('postbuild-copy-bundle/Framework-Info.plist')
53 contents = contents.replace('RandomValue', 'NewRandomValue') 56 contents = contents.replace('RandomValue', 'NewRandomValue')
54 test.write('postbuild-copy-bundle/Framework-Info.plist', contents) 57 test.write('postbuild-copy-bundle/Framework-Info.plist', contents)
55 test.build('test.gyp', 'test_app', chdir=CHDIR) 58 test.build('test.gyp', 'test_app', chdir=CHDIR)
56 59
57 test.must_exist(final_plist_path) 60 test.must_exist(final_plist_path)
58 test.must_contain(final_plist_path, '''\ 61 test.must_contain(final_plist_path, '''\
59 \t<key>RandomKey</key> 62 \t<key>RandomKey</key>
60 \t<string>NewRandomValue</string>''') 63 \t<string>NewRandomValue</string>''')
61 64
65 # Check the same for the copies section, test for http://crbug.com/157077
66 test.sleep()
67 contents = test.read('postbuild-copy-bundle/copied.txt')
68 contents = contents.replace('old', 'new')
69 test.write('postbuild-copy-bundle/copied.txt', contents)
70 test.build('test.gyp', 'test_app', chdir=CHDIR)
71
72 test.must_exist(final_copies_path)
73 test.must_contain(final_copies_path, 'new copied file')
74
62 test.pass_test() 75 test.pass_test()
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/mac/postbuild-copy-bundle/copied.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698