OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 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 | 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 Test variable expansion of '<!()' syntax commands. | 8 Test variable expansion of '<!()' syntax commands. |
9 """ | 9 """ |
10 | 10 |
| 11 from __future__ import print_function |
11 import os | 12 import os |
12 | 13 |
13 import TestGyp | 14 import TestGyp |
14 | 15 |
15 test = TestGyp.TestGyp(format='gypd') | 16 test = TestGyp.TestGyp(format='gypd') |
16 | 17 |
17 expect = test.read('commands.gyp.stdout').replace('\r', '') | 18 expect = test.read('commands.gyp.stdout').replace('\r', '') |
18 | 19 |
19 test.run_gyp('commands.gyp', | 20 test.run_gyp('commands.gyp', |
20 '--debug', 'variables', | 21 '--debug', 'variables', |
21 stdout=expect, ignore_line_numbers=True) | 22 stdout=expect, ignore_line_numbers=True) |
22 | 23 |
23 # Verify the commands.gypd against the checked-in expected contents. | 24 # Verify the commands.gypd against the checked-in expected contents. |
24 # | 25 # |
25 # Normally, we should canonicalize line endings in the expected | 26 # Normally, we should canonicalize line endings in the expected |
26 # contents file setting the Subversion svn:eol-style to native, | 27 # contents file setting the Subversion svn:eol-style to native, |
27 # but that would still fail if multiple systems are sharing a single | 28 # but that would still fail if multiple systems are sharing a single |
28 # workspace on a network-mounted file system. Consequently, we | 29 # workspace on a network-mounted file system. Consequently, we |
29 # massage the Windows line endings ('\r\n') in the output to the | 30 # massage the Windows line endings ('\r\n') in the output to the |
30 # checked-in UNIX endings ('\n'). | 31 # checked-in UNIX endings ('\n'). |
31 | 32 |
32 contents = test.read('commands.gypd').replace('\r', '') | 33 contents = test.read('commands.gypd').replace('\r', '') |
33 expect = test.read('commands.gypd.golden').replace('\r', '') | 34 expect = test.read('commands.gypd.golden').replace('\r', '') |
34 if not test.match(contents, expect): | 35 if not test.match(contents, expect): |
35 print "Unexpected contents of `commands.gypd'" | 36 print("Unexpected contents of `commands.gypd'") |
36 test.diff(expect, contents, 'commands.gypd ') | 37 test.diff(expect, contents, 'commands.gypd ') |
37 test.fail_test() | 38 test.fail_test() |
38 | 39 |
39 test.pass_test() | 40 test.pass_test() |
OLD | NEW |