Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1480)

Unified Diff: test/actions-args-change/gyptest-all.py

Issue 10375015: MSVS 2008: Fix to ensure that actions are re-run when the command changes (v2) (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Style Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | test/actions-args-change/src/arg-action.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'))
+
+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()
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | test/actions-args-change/src/arg-action.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698