| 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 Verifies that invalid strings files cause the build to fail. | 8 Verifies that invalid strings files cause the build to fail. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 from __future__ import print_function |
| 12 |
| 11 import TestCmd | 13 import TestCmd |
| 12 import TestGyp | 14 import TestGyp |
| 13 | 15 |
| 14 import sys | 16 import sys |
| 15 | 17 |
| 16 if sys.platform == 'darwin': | 18 if sys.platform == 'darwin': |
| 17 print "This test is currently disabled: https://crbug.com/483696." | 19 print("This test is currently disabled: https://crbug.com/483696.") |
| 18 sys.exit(0) | 20 sys.exit(0) |
| 19 | 21 |
| 20 expected_error = 'Old-style plist parser: missing semicolon in dictionary' | 22 expected_error = 'Old-style plist parser: missing semicolon in dictionary' |
| 21 saw_expected_error = [False] # Python2 has no "nonlocal" keyword. | 23 saw_expected_error = [False] # Python2 has no "nonlocal" keyword. |
| 22 def match(a, b): | 24 def match(a, b): |
| 23 if a == b: | 25 if a == b: |
| 24 return True | 26 return True |
| 25 if not TestCmd.is_List(a): | 27 if not TestCmd.is_List(a): |
| 26 a = a.split('\n') | 28 a = a.split('\n') |
| 27 if not TestCmd.is_List(b): | 29 if not TestCmd.is_List(b): |
| (...skipping 10 matching lines...) Expand all Loading... |
| 38 | 40 |
| 39 # Ninja pipes stderr of subprocesses to stdout. | 41 # Ninja pipes stderr of subprocesses to stdout. |
| 40 if test.format in ['ninja', 'xcode-ninja'] \ | 42 if test.format in ['ninja', 'xcode-ninja'] \ |
| 41 and expected_error in test.stdout(): | 43 and expected_error in test.stdout(): |
| 42 saw_expected_error[0] = True | 44 saw_expected_error[0] = True |
| 43 | 45 |
| 44 if saw_expected_error[0]: | 46 if saw_expected_error[0]: |
| 45 test.pass_test() | 47 test.pass_test() |
| 46 else: | 48 else: |
| 47 test.fail_test() | 49 test.fail_test() |
| OLD | NEW |