| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """test_expectations.txt presubmit script. | 5 """test_expectations.txt presubmit script. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 8 details on the presubmit API built into gcl. | 8 details on the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 TEST_EXPECTATIONS = 'test_expectations.txt' | 11 TEST_EXPECTATIONS = 'test_expectations.txt' |
| 12 | 12 |
| 13 def LintTestFiles(input_api, output_api): | 13 def LintTestFiles(input_api, output_api): |
| 14 current_dir = input_api.PresubmitLocalPath() | 14 current_dir = str(input_api.PresubmitLocalPath()) |
| 15 # Set 'webkit/tools/layout_tests' in include path. | 15 # Set 'webkit/tools/layout_tests' in include path. |
| 16 python_paths = [ | 16 python_paths = [ |
| 17 current_dir, | 17 current_dir, |
| 18 input_api.os_path.join(current_dir, '..', '..', '..', 'tools', 'python') | 18 input_api.os_path.join(current_dir, '..', '..', '..', 'tools', 'python') |
| 19 ] | 19 ] |
| 20 env = input_api.environ.copy() | 20 env = input_api.environ.copy() |
| 21 if env.get('PYTHONPATH'): | 21 if env.get('PYTHONPATH'): |
| 22 python_paths.append(env['PYTHONPATH']) | 22 python_paths.append(env['PYTHONPATH']) |
| 23 env['PYTHONPATH'] = input_api.os_path.pathsep.join(python_paths) | 23 env['PYTHONPATH'] = input_api.os_path.pathsep.join(python_paths) |
| 24 args = [ | 24 args = [ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 if TEST_EXPECTATIONS == input_api.os_path.basename(path): | 48 if TEST_EXPECTATIONS == input_api.os_path.basename(path): |
| 49 return LintTestFiles(input_api, output_api) | 49 return LintTestFiles(input_api, output_api) |
| 50 return [] | 50 return [] |
| 51 | 51 |
| 52 | 52 |
| 53 def CheckChangeOnUpload(input_api, output_api): | 53 def CheckChangeOnUpload(input_api, output_api): |
| 54 return LintTestExpectations(input_api, output_api) | 54 return LintTestExpectations(input_api, output_api) |
| 55 | 55 |
| 56 def CheckChangeOnCommit(input_api, output_api): | 56 def CheckChangeOnCommit(input_api, output_api): |
| 57 return LintTestExpectations(input_api, output_api) | 57 return LintTestExpectations(input_api, output_api) |
| OLD | NEW |