media/webrtc/trunk/tools/gyp/test/hard_dependency/gyptest-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-exported-hard-dependency.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     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 exported is pulled in as a dependency
    1.12 +for a target if the target is a static library and if the generator will
    1.13 +remove dependencies between static libraries.
    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 libraries.\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', 'c', chdir=chdir)
    1.30 +
    1.31 +# The 'a' static library should be built, as it has actions with side-effects
    1.32 +# that are necessary to compile 'c'. Even though 'c' does not directly depend
    1.33 +# on 'a', because 'a' is a hard_dependency that 'b' exports, 'c' should import
    1.34 +# it as a hard_dependency and ensure it is built before building 'c'.
    1.35 +test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir)
    1.36 +test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir)
    1.37 +test.built_file_must_exist('c', type=test.STATIC_LIB, chdir=chdir)
    1.38 +test.built_file_must_not_exist('d', type=test.STATIC_LIB, chdir=chdir)
    1.39 +
    1.40 +test.pass_test()

mercurial