media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.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/library/gyptest-shared-obj-install-path.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +# Copyright (c) 2012 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 +Verifies that .so files that are order only dependencies are specified by
    1.12 +their install location rather than by their alias.
    1.13 +"""
    1.14 +
    1.15 +# Python 2.5 needs this for the with statement.
    1.16 +from __future__ import with_statement
    1.17 +
    1.18 +import os
    1.19 +import TestGyp
    1.20 +
    1.21 +test = TestGyp.TestGyp(formats=['make'])
    1.22 +
    1.23 +test.run_gyp('shared_dependency.gyp',
    1.24 +             chdir='src')
    1.25 +test.relocate('src', 'relocate/src')
    1.26 +
    1.27 +test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
    1.28 +
    1.29 +if test.format=='android':
    1.30 +  makefile_path = 'relocate/src/GypAndroid.mk'
    1.31 +else:
    1.32 +  makefile_path = 'relocate/src/Makefile'
    1.33 +
    1.34 +with open(makefile_path) as makefile:
    1.35 +  make_contents = makefile.read()
    1.36 +
    1.37 +# If we remove the code to generate lib1, Make should still be able
    1.38 +# to build lib2 since lib1.so already exists.
    1.39 +make_contents = make_contents.replace('include lib1.target.mk', '')
    1.40 +with open(makefile_path, 'w') as makefile:
    1.41 +  makefile.write(make_contents)
    1.42 +
    1.43 +test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
    1.44 +
    1.45 +test.pass_test()

mercurial