gyptest-regyp.py 828 B

1234567891011121314151617181920212223242526272829303132
  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. """
  6. Verifies that Makefiles get rebuilt when a source gyp file changes.
  7. """
  8. import TestGyp
  9. # Regenerating build files when a gyp file changes is currently only supported
  10. # by the make generator.
  11. test = TestGyp.TestGyp(formats=['make'])
  12. test.run_gyp('hello.gyp')
  13. test.build('hello.gyp', test.ALL)
  14. test.run_built_executable('hello', stdout="Hello, world!\n")
  15. # Sleep so that the changed gyp file will have a newer timestamp than the
  16. # previously generated build files.
  17. test.sleep()
  18. test.write('hello.gyp', test.read('hello2.gyp'))
  19. test.build('hello.gyp', test.ALL)
  20. test.run_built_executable('hello', stdout="Hello, two!\n")
  21. test.pass_test()