gyptest-default.py 708 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # Copyright (c) 2009 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 with two targets that share a common .c source file.
  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', chdir='relocate/src')
  13. expect1 = """\
  14. Hello from prog1.c
  15. Hello prog1 from func.c
  16. """
  17. expect2 = """\
  18. Hello from prog2.c
  19. Hello prog2 from func.c
  20. """
  21. test.run_built_executable('prog1', chdir='relocate/src', stdout=expect1)
  22. test.run_built_executable('prog2', chdir='relocate/src', stdout=expect2)
  23. test.pass_test()