media/webrtc/trunk/tools/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/trunk/tools/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +# Copyright (c) 2009 Google Inc. All rights reserved.
     1.7 +# Use of this source code is governed by a BSD-style license that can be
     1.8 +# found in the LICENSE file.
     1.9 +
    1.10 +"""
    1.11 +Verify that a hard_dependency that is not exported is not pulled in as a
    1.12 +dependency for a target if the target does not explicitly specify a dependency
    1.13 +and none of its dependencies export the hard_dependency.
    1.14 +"""
    1.15 +
    1.16 +import TestGyp
    1.17 +
    1.18 +test = TestGyp.TestGyp()
    1.19 +
    1.20 +if test.format == 'dump_dependency_json':
    1.21 +  test.skip_test('Skipping test; dependency JSON does not adjust ' \
    1.22 +                 'static libaries.\n')
    1.23 +
    1.24 +test.run_gyp('hard_dependency.gyp', chdir='src')
    1.25 +
    1.26 +chdir = 'relocate/src'
    1.27 +test.relocate('src', chdir)
    1.28 +
    1.29 +test.build('hard_dependency.gyp', 'd', chdir=chdir)
    1.30 +
    1.31 +# Because 'c' does not export a hard_dependency, only the target 'd' should
    1.32 +# be built. This is because the 'd' target does not need the generated headers
    1.33 +# in order to be compiled.
    1.34 +test.built_file_must_not_exist('a', type=test.STATIC_LIB, chdir=chdir)
    1.35 +test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir)
    1.36 +test.built_file_must_not_exist('c', type=test.STATIC_LIB, chdir=chdir)
    1.37 +test.built_file_must_exist('d', type=test.STATIC_LIB, chdir=chdir)
    1.38 +
    1.39 +test.pass_test()

mercurial