OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 """Presubmit script for perf_expectations. | 5 """Presubmit script for perf_expectations. |
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 depot_tools. |
9 """ | 9 """ |
10 | 10 |
11 PERF_EXPECTATIONS = 'tools/perf_expectations/perf_expectations.json' | 11 PERF_EXPECTATIONS = 'tools/perf_expectations/perf_expectations.json' |
12 CONFIG_FILE = 'tools/perf_expectations/chromium_perf_expectations.cfg' | 12 CONFIG_FILE = 'tools/perf_expectations/chromium_perf_expectations.cfg' |
13 | 13 |
14 def CheckChangeOnUpload(input_api, output_api): | 14 def CheckChangeOnUpload(input_api, output_api): |
15 run_tests = False | 15 run_tests = False |
16 for path in input_api.LocalPaths(): | 16 for path in input_api.LocalPaths(): |
17 if (PERF_EXPECTATIONS == path or CONFIG_FILE == path): | 17 if (PERF_EXPECTATIONS == path or CONFIG_FILE == path): |
18 run_tests = True | 18 run_tests = True |
(...skipping 14 matching lines...) Expand all Loading... |
33 | 33 |
34 output = [] | 34 output = [] |
35 if run_tests: | 35 if run_tests: |
36 whitelist = [r'.+_unittest\.py$'] | 36 whitelist = [r'.+_unittest\.py$'] |
37 output.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 37 output.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
38 input_api, output_api, 'tests', whitelist)) | 38 input_api, output_api, 'tests', whitelist)) |
39 | 39 |
40 output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api, | 40 output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api, |
41 output_api)) | 41 output_api)) |
42 return output | 42 return output |
OLD | NEW |