1#!/usr/bin/env python 2 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. 6 7""" 8Verify that a hard_dependency that is exported is pulled in as a dependency 9for a target if the target is a static library and if the generator will 10remove dependencies between static libraries. 11""" 12 13import TestGyp 14 15test = TestGyp.TestGyp() 16 17if test.format == 'dump_dependency_json': 18 test.skip_test('Skipping test; dependency JSON does not adjust ' \ 19 'static libraries.\n') 20 21test.run_gyp('hard_dependency.gyp', chdir='src') 22 23chdir = 'relocate/src' 24test.relocate('src', chdir) 25 26test.build('hard_dependency.gyp', 'c', chdir=chdir) 27 28# 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 30# 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'. 32test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir) 33test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir) 34test.built_file_must_exist('c', type=test.STATIC_LIB, chdir=chdir) 35test.built_file_must_not_exist('d', type=test.STATIC_LIB, chdir=chdir) 36 37test.pass_test() 38