1
0

gyptest-all.py 1.3 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. 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.build('build/all.gyp', test.ALL, chdir='src')
  14. chdir = 'src/build'
  15. # The top-level Makefile is in the directory where gyp was run.
  16. # TODO(mmoss) Should the Makefile go in the directory of the passed in .gyp
  17. # file? What about when passing in multiple .gyp files? Would sub-project
  18. # Makefiles (see http://codereview.chromium.org/340008 comments) solve this?
  19. if test.format in ('make', 'ninja', 'cmake'):
  20. chdir = 'src'
  21. if test.format == 'xcode':
  22. chdir = 'src/prog1'
  23. test.run_built_executable('program1',
  24. chdir=chdir,
  25. stdout="Hello from prog1.c\n")
  26. if test.format == 'xcode':
  27. chdir = 'src/prog2'
  28. test.run_built_executable('program2',
  29. chdir=chdir,
  30. stdout="Hello from prog2.c\n")
  31. test.pass_test()