michael@0: #!/usr/bin/env python michael@0: michael@0: # Copyright (c) 2009 Google Inc. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: """ michael@0: Verify that a hard_dependency that is exported is pulled in as a dependency michael@0: for a target if the target is a static library and if the generator will michael@0: remove dependencies between static libraries. michael@0: """ michael@0: michael@0: import TestGyp michael@0: michael@0: test = TestGyp.TestGyp() michael@0: michael@0: if test.format == 'dump_dependency_json': michael@0: test.skip_test('Skipping test; dependency JSON does not adjust ' \ michael@0: 'static libraries.\n') michael@0: michael@0: test.run_gyp('hard_dependency.gyp', chdir='src') michael@0: michael@0: chdir = 'relocate/src' michael@0: test.relocate('src', chdir) michael@0: michael@0: test.build('hard_dependency.gyp', 'c', chdir=chdir) michael@0: michael@0: # The 'a' static library should be built, as it has actions with side-effects michael@0: # that are necessary to compile 'c'. Even though 'c' does not directly depend michael@0: # on 'a', because 'a' is a hard_dependency that 'b' exports, 'c' should import michael@0: # it as a hard_dependency and ensure it is built before building 'c'. michael@0: test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) michael@0: test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir) michael@0: test.built_file_must_exist('c', type=test.STATIC_LIB, chdir=chdir) michael@0: test.built_file_must_not_exist('d', type=test.STATIC_LIB, chdir=chdir) michael@0: michael@0: test.pass_test()