summaryrefslogtreecommitdiff
path: root/deps/gyp/test/hello/gyptest-regyp.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/hello/gyptest-regyp.py')
-rwxr-xr-xdeps/gyp/test/hello/gyptest-regyp.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/deps/gyp/test/hello/gyptest-regyp.py b/deps/gyp/test/hello/gyptest-regyp.py
new file mode 100755
index 0000000000..b513edcd07
--- /dev/null
+++ b/deps/gyp/test/hello/gyptest-regyp.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies that Makefiles get rebuilt when a source gyp file changes.
+"""
+
+import TestGyp
+
+# Regenerating build files when a gyp file changes is currently only supported
+# by the make generator.
+test = TestGyp.TestGyp(formats=['make'])
+
+test.run_gyp('hello.gyp')
+
+test.build('hello.gyp', test.ALL)
+
+test.run_built_executable('hello', stdout="Hello, world!\n")
+
+# Sleep so that the changed gyp file will have a newer timestamp than the
+# previously generated build files.
+test.sleep()
+test.write('hello.gyp', test.read('hello2.gyp'))
+
+test.build('hello.gyp', test.ALL)
+
+test.run_built_executable('hello', stdout="Hello, two!\n")
+
+test.pass_test()