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 building an object file correctly depends on running actions in | 8 Verify that building an object file correctly depends on running actions in |
9 dependent targets, but not the targets themselves. | 9 dependent targets, but not the targets themselves. |
10 """ | 10 """ |
11 | 11 |
12 import os | 12 import os |
13 import sys | 13 import sys |
14 import TestGyp | 14 import TestGyp |
15 | 15 |
16 # NOTE(piman): This test will not work with other generators because: | 16 # NOTE(piman): This test will not work with other generators because: |
17 # - it explicitly tests the optimization, which is not implemented (yet?) on | 17 # - it explicitly tests the optimization, which is not implemented (yet?) on |
18 # other generators | 18 # other generators |
19 # - it relies on the exact path to output object files, which is generator | 19 # - it relies on the exact path to output object files, which is generator |
20 # dependent, and actually, relies on the ability to build only that object file, | 20 # dependent, and actually, relies on the ability to build only that object file, |
21 # which I don't think is available on all generators. | 21 # which I don't think is available on all generators. |
22 # TODO(piman): Extend to other generators when possible. | 22 # TODO(piman): Extend to other generators when possible. |
23 test = TestGyp.TestGyp(formats=['ninja']) | 23 test = TestGyp.TestGyp(formats=['ninja']) |
24 if test.format == 'xcode-ninja': | |
sdefresne
2014/09/02 15:13:05
Please document why this test is ignored when usin
Tobias
2014/10/02 18:19:19
As explained in the comment above "NOTE(piman) [..
| |
25 test.skip_test() | |
24 | 26 |
25 test.run_gyp('action_dependencies.gyp', chdir='src') | 27 test.run_gyp('action_dependencies.gyp', chdir='src') |
26 | 28 |
27 chdir = 'relocate/src' | 29 chdir = 'relocate/src' |
28 test.relocate('src', chdir) | 30 test.relocate('src', chdir) |
29 | 31 |
30 objext = '.obj' if sys.platform == 'win32' else '.o' | 32 objext = '.obj' if sys.platform == 'win32' else '.o' |
31 | 33 |
32 test.build('action_dependencies.gyp', | 34 test.build('action_dependencies.gyp', |
33 os.path.join('obj', 'b.b' + objext), | 35 os.path.join('obj', 'b.b' + objext), |
(...skipping 10 matching lines...) Expand all Loading... | |
44 chdir=chdir) | 46 chdir=chdir) |
45 | 47 |
46 # 'a' and 'b' should be built, so that the 'c' action succeeds, letting c.c | 48 # 'a' and 'b' should be built, so that the 'c' action succeeds, letting c.c |
47 # compile | 49 # compile |
48 test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) | 50 test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) |
49 test.built_file_must_exist('b', type=test.EXECUTABLE, chdir=chdir) | 51 test.built_file_must_exist('b', type=test.EXECUTABLE, chdir=chdir) |
50 test.built_file_must_exist(os.path.join('obj', 'c.c' + objext), chdir=chdir) | 52 test.built_file_must_exist(os.path.join('obj', 'c.c' + objext), chdir=chdir) |
51 | 53 |
52 | 54 |
53 test.pass_test() | 55 test.pass_test() |
OLD | NEW |