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