media/webrtc/trunk/tools/gyp/test/library/gyptest-shared-obj-install-path.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.

michael@0 1 #!/usr/bin/env python
michael@0 2
michael@0 3 # Copyright (c) 2012 Google Inc. All rights reserved.
michael@0 4 # Use of this source code is governed by a BSD-style license that can be
michael@0 5 # found in the LICENSE file.
michael@0 6
michael@0 7 """
michael@0 8 Verifies that .so files that are order only dependencies are specified by
michael@0 9 their install location rather than by their alias.
michael@0 10 """
michael@0 11
michael@0 12 # Python 2.5 needs this for the with statement.
michael@0 13 from __future__ import with_statement
michael@0 14
michael@0 15 import os
michael@0 16 import TestGyp
michael@0 17
michael@0 18 test = TestGyp.TestGyp(formats=['make'])
michael@0 19
michael@0 20 test.run_gyp('shared_dependency.gyp',
michael@0 21 chdir='src')
michael@0 22 test.relocate('src', 'relocate/src')
michael@0 23
michael@0 24 test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
michael@0 25
michael@0 26 if test.format=='android':
michael@0 27 makefile_path = 'relocate/src/GypAndroid.mk'
michael@0 28 else:
michael@0 29 makefile_path = 'relocate/src/Makefile'
michael@0 30
michael@0 31 with open(makefile_path) as makefile:
michael@0 32 make_contents = makefile.read()
michael@0 33
michael@0 34 # If we remove the code to generate lib1, Make should still be able
michael@0 35 # to build lib2 since lib1.so already exists.
michael@0 36 make_contents = make_contents.replace('include lib1.target.mk', '')
michael@0 37 with open(makefile_path, 'w') as makefile:
michael@0 38 makefile.write(make_contents)
michael@0 39
michael@0 40 test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
michael@0 41
michael@0 42 test.pass_test()

mercurial