| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 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 a hard_dependency that is exported is pulled in as a dependency | 8 Verify that a hard_dependency that is exported is pulled in as a dependency |
| 9 for a target if the target is a static library and if the generator will | 9 for a target if the target is a static library and if the generator will |
| 10 remove dependencies between static libraries. | 10 remove dependencies between static libraries. |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import TestGyp | 13 import TestGyp |
| 14 | 14 |
| 15 test = TestGyp.TestGyp() | 15 test = TestGyp.TestGyp() |
| 16 | 16 |
| 17 if test.format == 'dump_dependency_json': | 17 if test.format == 'dump_dependency_json': |
| 18 test.skip_test('Skipping test; dependency JSON does not adjust ' \ | 18 test.skip_test('Skipping test; dependency JSON does not adjust ' \ |
| 19 'static libraries.\n') | 19 'static libraries.\n') |
| 20 | 20 |
| 21 test.run_gyp('hard_dependency.gyp', chdir='src') | 21 test.run_gyp('hard_dependency.gyp', |
| 22 '-G', 'xcode_ninja_target_pattern=^c$', |
| 23 chdir='src') |
| 22 | 24 |
| 23 chdir = 'relocate/src' | 25 chdir = 'relocate/src' |
| 24 test.relocate('src', chdir) | 26 test.relocate('src', chdir) |
| 25 | 27 |
| 26 test.build('hard_dependency.gyp', 'c', chdir=chdir) | 28 test.build('hard_dependency.gyp', 'c', chdir=chdir) |
| 27 | 29 |
| 28 # The 'a' static library should be built, as it has actions with side-effects | 30 # The 'a' static library should be built, as it has actions with side-effects |
| 29 # that are necessary to compile 'c'. Even though 'c' does not directly depend | 31 # that are necessary to compile 'c'. Even though 'c' does not directly depend |
| 30 # on 'a', because 'a' is a hard_dependency that 'b' exports, 'c' should import | 32 # on 'a', because 'a' is a hard_dependency that 'b' exports, 'c' should import |
| 31 # it as a hard_dependency and ensure it is built before building 'c'. | 33 # it as a hard_dependency and ensure it is built before building 'c'. |
| 32 test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) | 34 test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) |
| 33 test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir) | 35 test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir) |
| 34 test.built_file_must_exist('c', type=test.STATIC_LIB, chdir=chdir) | 36 test.built_file_must_exist('c', type=test.STATIC_LIB, chdir=chdir) |
| 35 test.built_file_must_not_exist('d', type=test.STATIC_LIB, chdir=chdir) | 37 test.built_file_must_not_exist('d', type=test.STATIC_LIB, chdir=chdir) |
| 36 | 38 |
| 37 test.pass_test() | 39 test.pass_test() |
| OLD | NEW |