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