OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 | |
3 # Copyright (c) 2012 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 actions get re-run when their arguments change. | |
9 | |
10 This is a regression test for http://code.google.com/p/gyp/issues/detail?id=262 | |
11 """ | |
12 | |
13 import os | |
14 | |
15 import TestGyp | |
16 | |
17 | |
18 def ReadFile(filename): | |
19 fh = open(filename, "r") | |
20 try: | |
21 return fh.read() | |
22 finally: | |
23 fh.close() | |
24 | |
25 | |
26 def WriteFile(filename, data): | |
27 fh = open(filename, "w") | |
28 try: | |
29 fh.write(data) | |
30 finally: | |
31 fh.close() | |
32 | |
33 | |
34 test = TestGyp.TestGyp() | |
35 | |
36 test.run_gyp('arg-action.gyp', chdir='src') | |
37 test.build('arg-action.gyp', chdir='src') | |
38 test.built_file_must_match('dest-file.txt', 'ARG_VALUE_1', chdir='src') | |
39 | |
40 gypi_file = os.path.join(test.workdir, 'src', 'arg-action.gypi') | |
41 data = ReadFile(gypi_file) | |
42 WriteFile(gypi_file, data.replace('ARG_VALUE_1', 'ARG_VALUE_2')) | |
43 | |
44 test.run_gyp('arg-action.gyp', chdir='src') | |
45 test.build('arg-action.gyp', chdir='src') | |
46 test.built_file_must_match('dest-file.txt', 'ARG_VALUE_2', chdir='src') | |
47 | |
48 test.pass_test() | |
OLD | NEW |