OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2011 Google Inc. All rights reserved. | 3 # Copyright (c) 2011 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 failing postbuild step lets the build fail. | 8 Verifies that a failing postbuild step lets the build fail. |
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 # set |match| to ignore build stderr output. | 16 # set |match| to ignore build stderr output. |
17 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'], | 17 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'], |
18 match = lambda a, b: True) | 18 match = lambda a, b: True) |
19 | 19 |
20 test.run_gyp('test.gyp', chdir='postbuild-fail') | 20 test.run_gyp('test.gyp', chdir='postbuild-fail') |
21 | 21 |
22 build_error_code = { | 22 build_error_code = { |
23 'xcode': [1, 65], # 1 for xcode 3, 65 for xcode 4 (see `man sysexits`) | 23 'xcode': [1, 65], # 1 for xcode 3, 65 for xcode 4 (see `man sysexits`) |
24 'make': 2, | 24 'make': 2, |
25 'ninja': 1, | 25 'ninja': 1, |
| 26 'xcode-ninja': [1, 65], |
26 }[test.format] | 27 }[test.format] |
27 | 28 |
28 | 29 |
29 # If a postbuild fails, all postbuilds should be re-run on the next build. | 30 # If a postbuild fails, all postbuilds should be re-run on the next build. |
30 # In Xcode 3, even if the first postbuild fails the other postbuilds were | 31 # In Xcode 3, even if the first postbuild fails the other postbuilds were |
31 # still executed. In Xcode 4, postbuilds are stopped after the first | 32 # still executed. In Xcode 4, postbuilds are stopped after the first |
32 # failing postbuild. This test checks for the Xcode 4 behavior. | 33 # failing postbuild. This test checks for the Xcode 4 behavior. |
33 | 34 |
34 # Ignore this test on Xcode 3. | 35 # Ignore this test on Xcode 3. |
35 import subprocess | 36 import subprocess |
(...skipping 22 matching lines...) Expand all Loading... |
58 test.build('test.gyp', 'bundle', chdir='postbuild-fail', | 59 test.build('test.gyp', 'bundle', chdir='postbuild-fail', |
59 status=build_error_code) | 60 status=build_error_code) |
60 test.built_file_must_not_exist('dynamic_touch', | 61 test.built_file_must_not_exist('dynamic_touch', |
61 chdir='postbuild-fail') | 62 chdir='postbuild-fail') |
62 # Check for non-up-to-date-ness by checking if building again produces an | 63 # Check for non-up-to-date-ness by checking if building again produces an |
63 # error. | 64 # error. |
64 test.build('test.gyp', 'bundle', chdir='postbuild-fail', | 65 test.build('test.gyp', 'bundle', chdir='postbuild-fail', |
65 status=build_error_code) | 66 status=build_error_code) |
66 | 67 |
67 test.pass_test() | 68 test.pass_test() |
OLD | NEW |