gyptest-shared-obj-install-path.py 1.2 KB

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