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 """Top-level presubmit script for depot tools. | 5 """Top-level presubmit script for depot tools. |
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 depot_tools. | 8 details on the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 output_api, | 35 output_api, |
36 white_list=[r'.*\.py$'], | 36 white_list=[r'.*\.py$'], |
37 black_list=black_list)) | 37 black_list=black_list)) |
38 | 38 |
39 # TODO(maruel): Make sure at least one file is modified first. | 39 # TODO(maruel): Make sure at least one file is modified first. |
40 # TODO(maruel): If only tests are modified, only run them. | 40 # TODO(maruel): If only tests are modified, only run them. |
41 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 41 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
42 input_api, | 42 input_api, |
43 output_api, | 43 output_api, |
44 'tests', | 44 'tests', |
45 whitelist=[r'.*tests\.py$'], | 45 whitelist=[r'.*test\.py$'], |
46 blacklist=tests_to_black_list)) | 46 blacklist=tests_to_black_list)) |
47 return results | 47 return results |
48 | 48 |
49 | 49 |
50 def RunGitClTests(input_api, output_api): | 50 def RunGitClTests(input_api, output_api): |
51 """Run all the shells scripts in the directory test. | 51 """Run all the shells scripts in the directory test. |
52 """ | 52 """ |
53 if input_api.platform == 'win32': | 53 if input_api.platform == 'win32': |
54 # Skip for now as long as the test scripts are bash scripts. | 54 # Skip for now as long as the test scripts are bash scripts. |
55 return [] | 55 return [] |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 | 108 |
109 def CheckChangeOnCommit(input_api, output_api): | 109 def CheckChangeOnCommit(input_api, output_api): |
110 output = [] | 110 output = [] |
111 output.extend(CommonChecks(input_api, output_api, [])) | 111 output.extend(CommonChecks(input_api, output_api, [])) |
112 output.extend(input_api.canned_checks.CheckDoNotSubmit( | 112 output.extend(input_api.canned_checks.CheckDoNotSubmit( |
113 input_api, | 113 input_api, |
114 output_api)) | 114 output_api)) |
115 output.extend(RunGitClTests(input_api, output_api)) | 115 output.extend(RunGitClTests(input_api, output_api)) |
116 return output | 116 return output |
OLD | NEW |