Index: test/actions-args-change/gyptest-all.py |
diff --git a/test/actions-args-change/gyptest-all.py b/test/actions-args-change/gyptest-all.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..0a9a3e33cde554feb0b6ef3fdcb450f1cac4477b |
--- /dev/null |
+++ b/test/actions-args-change/gyptest-all.py |
@@ -0,0 +1,48 @@ |
+#!/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 actions get re-run when their arguments change. |
+ |
+This is a regression test for http://code.google.com/p/gyp/issues/detail?id=262 |
+""" |
+ |
+import os |
+ |
+import TestGyp |
+ |
+ |
+def ReadFile(filename): |
+ fh = open(filename, "r") |
+ try: |
+ return fh.read() |
+ finally: |
+ fh.close() |
+ |
+ |
+def WriteFile(filename, data): |
+ fh = open(filename, "w") |
+ try: |
+ fh.write(data) |
+ finally: |
+ fh.close() |
+ |
+ |
+test = TestGyp.TestGyp() |
+ |
+test.run_gyp('arg-action.gyp', chdir='src') |
+test.build('arg-action.gyp', chdir='src') |
+test.built_file_must_match('dest-file.txt', 'ARG_VALUE_1', chdir='src') |
+ |
+gypi_file = os.path.join(test.workdir, 'src', 'arg-action.gypi') |
+data = ReadFile(gypi_file) |
+WriteFile(gypi_file, data.replace('ARG_VALUE_1', 'ARG_VALUE_2')) |
jeanluc1
2012/05/02 23:13:52
Are you sure you'll be able to overwrite this file
Mark Seaborn
2012/05/02 23:38:32
You mean you're concerned that the test will fail
jeanluc1
2012/05/02 23:50:24
I was concerned that some version control systems
Mark Seaborn
2012/05/03 00:39:20
Sure, I see what you mean. Do you want me to fix
|
+ |
+test.run_gyp('arg-action.gyp', chdir='src') |
+test.build('arg-action.gyp', chdir='src') |
+test.built_file_must_match('dest-file.txt', 'ARG_VALUE_2', chdir='src') |
+ |
+test.pass_test() |