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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial