gyptest-disable-regyp.py 860 B

1234567891011121314151617181920212223242526272829303132
  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. Verifies that Makefiles don't get rebuilt when a source gyp file changes and
  7. the disable_regeneration generator flag is set.
  8. """
  9. import TestGyp
  10. test = TestGyp.TestGyp()
  11. test.run_gyp('hello.gyp', '-Gauto_regeneration=0')
  12. test.build('hello.gyp', test.ALL)
  13. test.run_built_executable('hello', stdout="Hello, world!\n")
  14. # Sleep so that the changed gyp file will have a newer timestamp than the
  15. # previously generated build files.
  16. test.sleep()
  17. test.write('hello.gyp', test.read('hello2.gyp'))
  18. test.build('hello.gyp', test.ALL)
  19. # Should still be the old executable, as regeneration was disabled.
  20. test.run_built_executable('hello', stdout="Hello, world!\n")
  21. test.pass_test()