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 targets have independent INTERMEDIATE_DIRs. | 8 Verifies that targets have independent INTERMEDIATE_DIRs. |
9 """ | 9 """ |
10 | 10 |
11 import TestGyp | 11 import TestGyp |
12 | 12 |
13 test = TestGyp.TestGyp() | 13 test = TestGyp.TestGyp() |
14 | 14 |
15 test.run_gyp('test.gyp', chdir='src') | 15 test.run_gyp('test.gyp', |
| 16 '-G', 'xcode_ninja_target_pattern=^target1$', |
| 17 chdir='src') |
| 18 |
16 test.build('test.gyp', 'target1', chdir='src') | 19 test.build('test.gyp', 'target1', chdir='src') |
17 # Check stuff exists. | 20 # Check stuff exists. |
18 intermediate_file1 = test.read('src/outfile.txt') | 21 intermediate_file1 = test.read('src/outfile.txt') |
19 test.must_contain(intermediate_file1, 'target1') | 22 test.must_contain(intermediate_file1, 'target1') |
20 | 23 |
21 shared_intermediate_file1 = test.read('src/shared_outfile.txt') | 24 shared_intermediate_file1 = test.read('src/shared_outfile.txt') |
22 test.must_contain(shared_intermediate_file1, 'shared_target1') | 25 test.must_contain(shared_intermediate_file1, 'shared_target1') |
23 | 26 |
24 test.run_gyp('test2.gyp', chdir='src') | 27 test.run_gyp('test2.gyp', |
| 28 '-G', 'xcode_ninja_target_pattern=^target2$', |
| 29 chdir='src') |
| 30 |
25 # Force the shared intermediate to be rebuilt. | 31 # Force the shared intermediate to be rebuilt. |
26 test.sleep() | 32 test.sleep() |
27 test.touch('src/shared_infile.txt') | 33 test.touch('src/shared_infile.txt') |
28 test.build('test2.gyp', 'target2', chdir='src') | 34 test.build('test2.gyp', 'target2', chdir='src') |
29 # Check INTERMEDIATE_DIR file didn't get overwritten but SHARED_INTERMEDIATE_DIR | 35 # Check INTERMEDIATE_DIR file didn't get overwritten but SHARED_INTERMEDIATE_DIR |
30 # file did. | 36 # file did. |
31 intermediate_file2 = test.read('src/outfile.txt') | 37 intermediate_file2 = test.read('src/outfile.txt') |
32 test.must_contain(intermediate_file1, 'target1') | 38 test.must_contain(intermediate_file1, 'target1') |
33 test.must_contain(intermediate_file2, 'target2') | 39 test.must_contain(intermediate_file2, 'target2') |
34 | 40 |
35 shared_intermediate_file2 = test.read('src/shared_outfile.txt') | 41 shared_intermediate_file2 = test.read('src/shared_outfile.txt') |
36 if shared_intermediate_file1 != shared_intermediate_file2: | 42 if shared_intermediate_file1 != shared_intermediate_file2: |
37 test.fail_test(shared_intermediate_file1 + ' != ' + shared_intermediate_file2) | 43 test.fail_test(shared_intermediate_file1 + ' != ' + shared_intermediate_file2) |
38 | 44 |
39 test.must_contain(shared_intermediate_file1, 'shared_target2') | 45 test.must_contain(shared_intermediate_file1, 'shared_target2') |
40 test.must_contain(shared_intermediate_file2, 'shared_target2') | 46 test.must_contain(shared_intermediate_file2, 'shared_target2') |
41 | 47 |
42 test.pass_test() | 48 test.pass_test() |
OLD | NEW |