Home | History | Annotate | Download | only in hello
      1 #!/usr/bin/env python
      2 
      3 # Copyright (c) 2009 Google Inc. All rights reserved.
      4 # Use of this source code is governed by a BSD-style license that can be
      5 # found in the LICENSE file.
      6 
      7 """
      8 Verifies that Makefiles don't get rebuilt when a source gyp file changes and
      9 the disable_regeneration generator flag is set.
     10 """
     11 
     12 import TestGyp
     13 
     14 test = TestGyp.TestGyp()
     15 
     16 test.run_gyp('hello.gyp', '-Gauto_regeneration=0')
     17 
     18 test.build('hello.gyp', test.ALL)
     19 
     20 test.run_built_executable('hello', stdout="Hello, world!\n")
     21 
     22 # Sleep so that the changed gyp file will have a newer timestamp than the
     23 # previously generated build files.
     24 test.sleep()
     25 test.write('hello.gyp', test.read('hello2.gyp'))
     26 
     27 test.build('hello.gyp', test.ALL)
     28 
     29 # Should still be the old executable, as regeneration was disabled.
     30 test.run_built_executable('hello', stdout="Hello, world!\n")
     31 
     32 test.pass_test()
     33