OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 changes affecting tools/perf/. | 5 """Presubmit script for changes affecting tools/perf/. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 stderr=input_api.subprocess.STDOUT) | 47 stderr=input_api.subprocess.STDOUT) |
48 out, _ = p.communicate() | 48 out, _ = p.communicate() |
49 return (out, p.returncode) | 49 return (out, p.returncode) |
50 | 50 |
51 | 51 |
52 def _CheckPerfJsonUpToDate(input_api, output_api): | 52 def _CheckPerfJsonUpToDate(input_api, output_api): |
53 results = [] | 53 results = [] |
54 perf_dir = input_api.PresubmitLocalPath() | 54 perf_dir = input_api.PresubmitLocalPath() |
55 out, return_code = _RunArgs([ | 55 out, return_code = _RunArgs([ |
56 input_api.python_executable, | 56 input_api.python_executable, |
57 input_api.os_path.join(perf_dir, 'generate_perf_json'), | 57 input_api.os_path.join(perf_dir, 'generate_perf_data'), |
58 '--validate-only'], input_api) | 58 '--validate-only'], input_api) |
59 if return_code: | 59 if return_code: |
60 results.append(output_api.PresubmitError( | 60 results.append(output_api.PresubmitError( |
61 'Validating Perf JSON configs failed.', long_text=out)) | 61 'Validating Perf JSON configs failed.', long_text=out)) |
62 return results | 62 return results |
63 | 63 |
64 | 64 |
65 def _CheckWprShaFiles(input_api, output_api): | 65 def _CheckWprShaFiles(input_api, output_api): |
66 """Check whether the wpr sha files have matching URLs.""" | 66 """Check whether the wpr sha files have matching URLs.""" |
67 old_sys_path = sys.path | 67 old_sys_path = sys.path |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 def CheckChangeOnUpload(input_api, output_api): | 112 def CheckChangeOnUpload(input_api, output_api): |
113 report = [] | 113 report = [] |
114 report.extend(_CommonChecks(input_api, output_api)) | 114 report.extend(_CommonChecks(input_api, output_api)) |
115 return report | 115 return report |
116 | 116 |
117 | 117 |
118 def CheckChangeOnCommit(input_api, output_api): | 118 def CheckChangeOnCommit(input_api, output_api): |
119 report = [] | 119 report = [] |
120 report.extend(_CommonChecks(input_api, output_api)) | 120 report.extend(_CommonChecks(input_api, output_api)) |
121 return report | 121 return report |
OLD | NEW |