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 will correctly rebuild. | 8 Verifies actions with multiple outputs will correctly rebuild. |
9 """ | 9 """ |
10 | 10 |
| 11 from __future__ import print_function |
| 12 |
11 import TestGyp | 13 import TestGyp |
12 import os | 14 import os |
13 import sys | 15 import sys |
14 | 16 |
15 if sys.platform == 'win32': | 17 if sys.platform == 'win32': |
16 print "This test is currently disabled: https://crbug.com/483696." | 18 print("This test is currently disabled: https://crbug.com/483696.") |
17 sys.exit(0) | 19 sys.exit(0) |
18 | 20 |
19 test = TestGyp.TestGyp() | 21 test = TestGyp.TestGyp() |
20 | 22 |
21 test.run_gyp('multiple-outputs.gyp', chdir='src') | 23 test.run_gyp('multiple-outputs.gyp', chdir='src') |
22 | 24 |
23 chdir = 'relocate/src' | 25 chdir = 'relocate/src' |
24 test.relocate('src', chdir) | 26 test.relocate('src', chdir) |
25 | 27 |
26 def build_and_check(): | 28 def build_and_check(): |
27 # Build + check that both outputs exist. | 29 # Build + check that both outputs exist. |
28 test.build('multiple-outputs.gyp', chdir=chdir) | 30 test.build('multiple-outputs.gyp', chdir=chdir) |
29 test.built_file_must_exist('out1.txt', chdir=chdir) | 31 test.built_file_must_exist('out1.txt', chdir=chdir) |
30 test.built_file_must_exist('out2.txt', chdir=chdir) | 32 test.built_file_must_exist('out2.txt', chdir=chdir) |
31 | 33 |
32 # Plain build. | 34 # Plain build. |
33 build_and_check() | 35 build_and_check() |
34 | 36 |
35 # Remove either + rebuild. Both should exist (again). | 37 # Remove either + rebuild. Both should exist (again). |
36 os.remove(test.built_file_path('out1.txt', chdir=chdir)) | 38 os.remove(test.built_file_path('out1.txt', chdir=chdir)) |
37 build_and_check(); | 39 build_and_check(); |
38 | 40 |
39 # Remove the other + rebuild. Both should exist (again). | 41 # Remove the other + rebuild. Both should exist (again). |
40 os.remove(test.built_file_path('out2.txt', chdir=chdir)) | 42 os.remove(test.built_file_path('out2.txt', chdir=chdir)) |
41 build_and_check(); | 43 build_and_check(); |
42 | 44 |
43 test.pass_test() | 45 test.pass_test() |
OLD | NEW |