gyptest-relocate.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. import TestGyp
  6. test = TestGyp.TestGyp()
  7. # The xcode-ninja generator handles gypfiles which are not at the
  8. # project root incorrectly.
  9. # cf. https://code.google.com/p/gyp/issues/detail?id=460
  10. if test.format == 'xcode-ninja':
  11. test.skip_test()
  12. test.run_gyp('build/all.gyp', chdir='src')
  13. test.relocate('src', 'relocate/src')
  14. test.build('build/all.gyp', test.ALL, chdir='relocate/src')
  15. chdir = 'relocate/src/build'
  16. # The top-level Makefile is in the directory where gyp was run.
  17. # TODO(mmoss) Should the Makefile go in the directory of the passed in .gyp
  18. # file? What about when passing in multiple .gyp files? Would sub-project
  19. # Makefiles (see http://codereview.chromium.org/340008 comments) solve this?
  20. if test.format in ('make', 'ninja', 'cmake'):
  21. chdir = 'relocate/src'
  22. if test.format == 'xcode':
  23. chdir = 'relocate/src/prog1'
  24. test.run_built_executable('program1',
  25. chdir=chdir,
  26. stdout="Hello from prog1.c\n")
  27. if test.format == 'xcode':
  28. chdir = 'relocate/src/prog2'
  29. test.run_built_executable('program2',
  30. chdir=chdir,
  31. stdout="Hello from prog2.c\n")
  32. test.pass_test()