| 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 rebuilt correctly. | 8 Verifies that app bundles are rebuilt correctly. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import TestGyp | 11 import TestGyp |
| 12 | 12 |
| 13 import sys | 13 import sys |
| 14 | 14 |
| 15 if sys.platform == 'darwin': | 15 if sys.platform == 'darwin': |
| 16 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | 16 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
| 17 | 17 |
| 18 CHDIR = 'rebuild' | 18 CHDIR = 'rebuild' |
| 19 test.run_gyp('test.gyp', chdir=CHDIR) | 19 test.run_gyp('test.gyp', |
| 20 '-G', 'xcode_ninja_target_pattern=^.*$', |
| 21 chdir=CHDIR) |
| 20 | 22 |
| 21 test.build('test.gyp', 'test_app', chdir=CHDIR) | 23 test.build('test.gyp', 'test_app', chdir=CHDIR) |
| 22 | 24 |
| 23 # Touch a source file, rebuild, and check that the app target is up-to-date. | 25 # Touch a source file, rebuild, and check that the app target is up-to-date. |
| 24 test.touch('rebuild/main.c') | 26 test.touch('rebuild/main.c') |
| 25 test.build('test.gyp', 'test_app', chdir=CHDIR) | 27 test.build('test.gyp', 'test_app', chdir=CHDIR) |
| 26 | 28 |
| 27 test.up_to_date('test.gyp', 'test_app', chdir=CHDIR) | 29 test.up_to_date('test.gyp', 'test_app', chdir=CHDIR) |
| 28 | 30 |
| 29 # Xcode runs postbuilds on every build, so targets with postbuilds are | 31 # Xcode runs postbuilds on every build, so targets with postbuilds are |
| 30 # never marked as up_to_date. | 32 # never marked as up_to_date. |
| 31 if test.format != 'xcode': | 33 if test.format != 'xcode': |
| 32 # Same for a framework bundle. | 34 # Same for a framework bundle. |
| 33 test.build('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) | 35 test.build('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) |
| 34 test.up_to_date('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) | 36 test.up_to_date('test.gyp', 'test_framework_postbuilds', chdir=CHDIR) |
| 35 | 37 |
| 36 # Test that an app bundle with a postbuild that touches the app binary needs | 38 # Test that an app bundle with a postbuild that touches the app binary needs |
| 37 # to be built only once. | 39 # to be built only once. |
| 38 test.build('test.gyp', 'test_app_postbuilds', chdir=CHDIR) | 40 test.build('test.gyp', 'test_app_postbuilds', chdir=CHDIR) |
| 39 test.up_to_date('test.gyp', 'test_app_postbuilds', chdir=CHDIR) | 41 test.up_to_date('test.gyp', 'test_app_postbuilds', chdir=CHDIR) |
| 40 | 42 |
| 41 test.pass_test() | 43 test.pass_test() |
| OLD | NEW |