michael@0: #!/usr/bin/env python michael@0: michael@0: # Copyright (c) 2012 Google Inc. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: """ michael@0: Verifies that .so files that are order only dependencies are specified by michael@0: their install location rather than by their alias. michael@0: """ michael@0: michael@0: # Python 2.5 needs this for the with statement. michael@0: from __future__ import with_statement michael@0: michael@0: import os michael@0: import TestGyp michael@0: michael@0: test = TestGyp.TestGyp(formats=['make']) michael@0: michael@0: test.run_gyp('shared_dependency.gyp', michael@0: chdir='src') michael@0: test.relocate('src', 'relocate/src') michael@0: michael@0: test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src') michael@0: michael@0: if test.format=='android': michael@0: makefile_path = 'relocate/src/GypAndroid.mk' michael@0: else: michael@0: makefile_path = 'relocate/src/Makefile' michael@0: michael@0: with open(makefile_path) as makefile: michael@0: make_contents = makefile.read() michael@0: michael@0: # If we remove the code to generate lib1, Make should still be able michael@0: # to build lib2 since lib1.so already exists. michael@0: make_contents = make_contents.replace('include lib1.target.mk', '') michael@0: with open(makefile_path, 'w') as makefile: michael@0: makefile.write(make_contents) michael@0: michael@0: test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src') michael@0: michael@0: test.pass_test()