Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 #!/usr/bin/env python
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
5 # found in the LICENSE file.
7 """
8 Verify that a hard_dependency that is not exported is not pulled in as a
9 dependency for a target if the target does not explicitly specify a dependency
10 and none of its dependencies export the hard_dependency.
11 """
13 import TestGyp
15 test = TestGyp.TestGyp()
17 if test.format == 'dump_dependency_json':
18 test.skip_test('Skipping test; dependency JSON does not adjust ' \
19 'static libaries.\n')
21 test.run_gyp('hard_dependency.gyp', chdir='src')
23 chdir = 'relocate/src'
24 test.relocate('src', chdir)
26 test.build('hard_dependency.gyp', 'd', chdir=chdir)
28 # Because 'c' does not export a hard_dependency, only the target 'd' should
29 # be built. This is because the 'd' target does not need the generated headers
30 # in order to be compiled.
31 test.built_file_must_not_exist('a', type=test.STATIC_LIB, chdir=chdir)
32 test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir)
33 test.built_file_must_not_exist('c', type=test.STATIC_LIB, chdir=chdir)
34 test.built_file_must_exist('d', type=test.STATIC_LIB, chdir=chdir)
36 test.pass_test()