• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2
3# Copyright (c) 2012 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.
6
7"""
8Verifies that .so files that are order only dependencies are specified by
9their install location rather than by their alias.
10"""
11
12# Python 2.5 needs this for the with statement.
13from __future__ import with_statement
14
15import os
16import TestGyp
17
18test = TestGyp.TestGyp(formats=['make'])
19
20test.run_gyp('shared_dependency.gyp',
21             chdir='src')
22test.relocate('src', 'relocate/src')
23
24test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
25
26if test.format=='android':
27  makefile_path = 'relocate/src/GypAndroid.mk'
28else:
29  makefile_path = 'relocate/src/Makefile'
30
31with open(makefile_path) as makefile:
32  make_contents = makefile.read()
33
34# If we remove the code to generate lib1, Make should still be able
35# to build lib2 since lib1.so already exists.
36make_contents = make_contents.replace('include lib1.target.mk', '')
37with open(makefile_path, 'w') as makefile:
38  makefile.write(make_contents)
39
40test.build('shared_dependency.gyp', test.ALL, chdir='relocate/src')
41
42test.pass_test()
43