gyptest-default.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/env python
  2. # Copyright (c) 2011 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 simple rules when using an explicit build target of 'all'.
  7. """
  8. import TestGyp
  9. test = TestGyp.TestGyp()
  10. test.run_gyp('actions.gyp',
  11. '-G', 'xcode_ninja_target_pattern=^pull_in_all_actions$',
  12. chdir='src')
  13. test.relocate('src', 'relocate/src')
  14. test.build('actions.gyp', chdir='relocate/src')
  15. expect = """\
  16. Hello from program.c
  17. Hello from function1.in
  18. Hello from function2.in
  19. """
  20. if test.format == 'xcode':
  21. chdir = 'relocate/src/subdir1'
  22. else:
  23. chdir = 'relocate/src'
  24. test.run_built_executable('program', chdir=chdir, stdout=expect)
  25. expect = """\
  26. Hello from program.c
  27. Hello from function3.in
  28. """
  29. if test.format == 'xcode':
  30. chdir = 'relocate/src/subdir3'
  31. else:
  32. chdir = 'relocate/src'
  33. test.run_built_executable('program2', chdir=chdir, stdout=expect)
  34. test.must_match('relocate/src/subdir2/file1.out', 'Hello from file1.in\n')
  35. test.must_match('relocate/src/subdir2/file2.out', 'Hello from file2.in\n')
  36. test.must_match('relocate/src/subdir2/file1.out2', 'Hello from file1.in\n')
  37. test.must_match('relocate/src/subdir2/file2.out2', 'Hello from file2.in\n')
  38. test.must_match('relocate/src/subdir2/file1.out4', 'Hello from file1.in\n')
  39. test.must_match('relocate/src/subdir2/file2.out4', 'Hello from file2.in\n')
  40. test.must_match('relocate/src/subdir2/file1.copy', 'Hello from file1.in\n')
  41. test.must_match('relocate/src/external/file1.external_rules.out',
  42. 'Hello from file1.in\n')
  43. test.must_match('relocate/src/external/file2.external_rules.out',
  44. 'Hello from file2.in\n')
  45. test.pass_test()