gyptest-all.py 794 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. Build a .gyp that depends on 2 gyp files with the same name.
  7. """
  8. import TestGyp
  9. test = TestGyp.TestGyp()
  10. test.run_gyp('all.gyp', chdir='src')
  11. test.relocate('src', 'relocate/src')
  12. test.build('all.gyp', test.ALL, chdir='relocate/src')
  13. expect1 = """\
  14. Hello from main1.cc
  15. """
  16. expect2 = """\
  17. Hello from main2.cc
  18. """
  19. if test.format == 'xcode':
  20. chdir1 = 'relocate/src/subdir1'
  21. chdir2 = 'relocate/src/subdir2'
  22. else:
  23. chdir1 = chdir2 = 'relocate/src'
  24. test.run_built_executable('program1', chdir=chdir1, stdout=expect1)
  25. test.run_built_executable('program2', chdir=chdir2, stdout=expect2)
  26. test.pass_test()