OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Top-level presubmit script for depot tools. | 6 """Top-level presubmit script for depot tools. |
7 | 7 |
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
9 details on the presubmit API built into gcl. | 9 details on the presubmit API built into gcl. |
10 """ | 10 """ |
11 | 11 |
12 UNIT_TESTS = [ | 12 UNIT_TESTS = [ |
13 'tests.gcl_unittest', | 13 'tests.gcl_unittest', |
14 'tests.gclient_test', | 14 'tests.gclient_test', |
15 'tests.gclient_scm_test', | 15 'tests.gclient_scm_test', |
16 'tests.gclient_utils_test', | 16 'tests.gclient_utils_test', |
17 'tests.presubmit_unittest', | 17 'tests.presubmit_unittest', |
18 'tests.revert_unittest', | |
19 'tests.scm_unittest', | 18 'tests.scm_unittest', |
20 'tests.trychange_unittest', | 19 'tests.trychange_unittest', |
21 'tests.watchlists_unittest', | 20 'tests.watchlists_unittest', |
22 ] | 21 ] |
23 | 22 |
24 def CheckChangeOnUpload(input_api, output_api): | 23 def CheckChangeOnUpload(input_api, output_api): |
25 output = [] | 24 output = [] |
26 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, | 25 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, |
27 output_api, | 26 output_api, |
28 UNIT_TESTS)) | 27 UNIT_TESTS)) |
29 return output | 28 return output |
30 | 29 |
31 | 30 |
32 def CheckChangeOnCommit(input_api, output_api): | 31 def CheckChangeOnCommit(input_api, output_api): |
33 output = [] | 32 output = [] |
34 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, | 33 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, |
35 output_api, | 34 output_api, |
36 UNIT_TESTS)) | 35 UNIT_TESTS)) |
37 output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api, | 36 output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api, |
38 output_api)) | 37 output_api)) |
39 return output | 38 return output |
OLD | NEW |