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 Verify that dependent rules are executed iff a dependency action modifies its | 8 Verify that dependent rules are executed iff a dependency action modifies its |
9 outputs. | 9 outputs. |
10 """ | 10 """ |
11 | 11 |
12 import TestGyp | 12 import TestGyp |
13 import os | 13 import os |
14 | 14 |
15 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | 15 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
16 | 16 |
17 test.run_gyp('restat.gyp', chdir='src') | 17 test.run_gyp('restat.gyp', |
| 18 '-G', 'xcode_ninja_target_pattern=^.*$', |
| 19 chdir='src') |
18 | 20 |
19 chdir = 'relocate/src' | 21 chdir = 'relocate/src' |
20 test.relocate('src', chdir) | 22 test.relocate('src', chdir) |
21 | 23 |
22 # Building 'dependent' the first time generates 'side_effect', but building it | 24 # Building 'dependent' the first time generates 'side_effect', but building it |
23 # the second time doesn't, because 'create_intermediate' doesn't update its | 25 # the second time doesn't, because 'create_intermediate' doesn't update its |
24 # output. | 26 # output. |
25 test.build('restat.gyp', 'dependent', chdir=chdir) | 27 test.build('restat.gyp', 'dependent', chdir=chdir) |
26 test.built_file_must_exist('side_effect', chdir=chdir) | 28 test.built_file_must_exist('side_effect', chdir=chdir) |
27 os.remove(test.built_file_path('side_effect', chdir=chdir)) | 29 os.remove(test.built_file_path('side_effect', chdir=chdir)) |
28 test.build('restat.gyp', 'dependent', chdir=chdir) | 30 test.build('restat.gyp', 'dependent', chdir=chdir) |
29 test.built_file_must_not_exist('side_effect', chdir=chdir) | 31 test.built_file_must_not_exist('side_effect', chdir=chdir) |
30 | 32 |
31 test.pass_test() | 33 test.pass_test() |
OLD | NEW |