OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2015 Google Inc. All rights reserved. | 3 # Copyright (c) 2015 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies actions with multiple outputs & dependncies will correctly rebuild. | 8 Verifies actions with multiple outputs & dependncies will correctly rebuild. |
9 | 9 |
10 This is a regression test for crrev.com/1177163002. | 10 This is a regression test for crrev.com/1177163002. |
11 """ | 11 """ |
12 | 12 |
| 13 from __future__ import print_function |
| 14 |
13 import TestGyp | 15 import TestGyp |
14 import os | 16 import os |
15 import sys | 17 import sys |
16 import time | 18 import time |
17 | 19 |
18 if sys.platform in ('darwin', 'win32'): | 20 if sys.platform in ('darwin', 'win32'): |
19 print "This test is currently disabled: https://crbug.com/483696." | 21 print("This test is currently disabled: https://crbug.com/483696.") |
20 sys.exit(0) | 22 sys.exit(0) |
21 | 23 |
22 test = TestGyp.TestGyp() | 24 test = TestGyp.TestGyp() |
23 | 25 |
24 TESTDIR='relocate/src' | 26 TESTDIR='relocate/src' |
25 test.run_gyp('action.gyp', chdir='src') | 27 test.run_gyp('action.gyp', chdir='src') |
26 test.relocate('src', TESTDIR) | 28 test.relocate('src', TESTDIR) |
27 | 29 |
28 def build_and_check(content): | 30 def build_and_check(content): |
29 test.write(TESTDIR + '/input.txt', content) | 31 test.write(TESTDIR + '/input.txt', content) |
30 test.build('action.gyp', 'upper', chdir=TESTDIR) | 32 test.build('action.gyp', 'upper', chdir=TESTDIR) |
31 test.built_file_must_match('result.txt', content, chdir=TESTDIR) | 33 test.built_file_must_match('result.txt', content, chdir=TESTDIR) |
32 | 34 |
33 build_and_check('Content for first build.') | 35 build_and_check('Content for first build.') |
34 | 36 |
35 # Ninja works with timestamps and the test above is fast enough that the | 37 # Ninja works with timestamps and the test above is fast enough that the |
36 # 'updated' file may end up with the same timestamp as the original, meaning | 38 # 'updated' file may end up with the same timestamp as the original, meaning |
37 # that ninja may not always recognize the input file has changed. | 39 # that ninja may not always recognize the input file has changed. |
38 if test.format == 'ninja': | 40 if test.format == 'ninja': |
39 time.sleep(1) | 41 time.sleep(1) |
40 | 42 |
41 build_and_check('An updated input file.') | 43 build_and_check('An updated input file.') |
42 | 44 |
43 test.pass_test() | 45 test.pass_test() |
OLD | NEW |