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 not exported is not pulled in as a michael@0: dependency for a target if the target does not explicitly specify a dependency michael@0: and none of its dependencies export the hard_dependency. 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 libaries.\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', 'd', chdir=chdir) michael@0: michael@0: # Because 'c' does not export a hard_dependency, only the target 'd' should michael@0: # be built. This is because the 'd' target does not need the generated headers michael@0: # in order to be compiled. michael@0: test.built_file_must_not_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_not_exist('c', type=test.STATIC_LIB, chdir=chdir) michael@0: test.built_file_must_exist('d', type=test.STATIC_LIB, chdir=chdir) michael@0: michael@0: test.pass_test()