gyptest-regyp-output.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # Copyright (c) 2013 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 that Makefiles get rebuilt when a source gyp file changes and
  7. --generator-output is used.
  8. """
  9. import TestGyp
  10. # Regenerating build files when a gyp file changes is currently only supported
  11. # by the make and Android generators, and --generator-output is not supported
  12. # by Android and ninja, so we can only test for make.
  13. test = TestGyp.TestGyp(formats=['make'])
  14. CHDIR='generator-output'
  15. test.run_gyp('hello.gyp', '--generator-output=%s' % CHDIR)
  16. test.build('hello.gyp', test.ALL, chdir=CHDIR)
  17. test.run_built_executable('hello', stdout="Hello, world!\n", chdir=CHDIR)
  18. # Sleep so that the changed gyp file will have a newer timestamp than the
  19. # previously generated build files.
  20. test.sleep()
  21. test.write('hello.gyp', test.read('hello2.gyp'))
  22. test.build('hello.gyp', test.ALL, chdir=CHDIR)
  23. test.run_built_executable('hello', stdout="Hello, two!\n", chdir=CHDIR)
  24. test.pass_test()