Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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() |