Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: test/variables/commands/gyptest-commands-repeated.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 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 from __future__ import print_function
13
12 import TestGyp 14 import TestGyp
13 15
14 test = TestGyp.TestGyp(format='gypd') 16 test = TestGyp.TestGyp(format='gypd')
15 17
16 expect = test.read('commands-repeated.gyp.stdout').replace('\r\n', '\n') 18 expect = test.read('commands-repeated.gyp.stdout').replace('\r\n', '\n')
17 19
18 test.run_gyp('commands-repeated.gyp', 20 test.run_gyp('commands-repeated.gyp',
19 '--debug', 'variables', 21 '--debug', 'variables',
20 stdout=expect, ignore_line_numbers=True) 22 stdout=expect, ignore_line_numbers=True)
21 23
22 # Verify the commands-repeated.gypd against the checked-in expected contents. 24 # Verify the commands-repeated.gypd against the checked-in expected contents.
23 # 25 #
24 # Normally, we should canonicalize line endings in the expected 26 # Normally, we should canonicalize line endings in the expected
25 # contents file setting the Subversion svn:eol-style to native, 27 # contents file setting the Subversion svn:eol-style to native,
26 # 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
27 # workspace on a network-mounted file system. Consequently, we 29 # workspace on a network-mounted file system. Consequently, we
28 # 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
29 # checked-in UNIX endings ('\n'). 31 # checked-in UNIX endings ('\n').
30 32
31 contents = test.read('commands-repeated.gypd').replace('\r\n', '\n') 33 contents = test.read('commands-repeated.gypd').replace('\r\n', '\n')
32 expect = test.read('commands-repeated.gypd.golden').replace('\r\n', '\n') 34 expect = test.read('commands-repeated.gypd.golden').replace('\r\n', '\n')
33 if not test.match(contents, expect): 35 if not test.match(contents, expect):
34 print "Unexpected contents of `commands-repeated.gypd'" 36 print("Unexpected contents of `commands-repeated.gypd'")
35 test.diff(expect, contents, 'commands-repeated.gypd ') 37 test.diff(expect, contents, 'commands-repeated.gypd ')
36 test.fail_test() 38 test.fail_test()
37 39
38 test.pass_test() 40 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698