maruel@chromium.org | 3d23524 | 2009-05-15 12:40:48 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 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 |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Top-level presubmit script for depot tools. |
| 7 | |
| 8 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 9 | details on the presubmit API built into gcl. |
| 10 | """ |
| 11 | |
maruel@chromium.org | ce30ef7 | 2009-05-25 15:20:42 +0000 | [diff] [blame] | 12 | UNIT_TESTS = [ |
| 13 | 'tests.gcl_unittest', |
| 14 | 'tests.gclient_test', |
| 15 | 'tests.presubmit_unittest', |
| 16 | 'tests.revert_unittest', |
| 17 | 'tests.trychange_unittest', |
| 18 | ] |
maruel@chromium.org | 3d23524 | 2009-05-15 12:40:48 +0000 | [diff] [blame] | 19 | |
| 20 | def CheckChangeOnUpload(input_api, output_api): |
maruel@chromium.org | 7b305e8 | 2009-05-19 18:24:20 +0000 | [diff] [blame] | 21 | output = [] |
| 22 | output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, |
| 23 | output_api, |
maruel@chromium.org | ce30ef7 | 2009-05-25 15:20:42 +0000 | [diff] [blame] | 24 | UNIT_TESTS)) |
| 25 | return output |
| 26 | |
| 27 | |
| 28 | def CheckChangeOnCommit(input_api, output_api): |
| 29 | output = [] |
| 30 | output.extend(input_api.canned_checks.RunPythonUnitTests(input_api, |
| 31 | output_api, |
| 32 | UNIT_TESTS)) |
maruel@chromium.org | 7b305e8 | 2009-05-19 18:24:20 +0000 | [diff] [blame] | 33 | output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api, |
| 34 | output_api)) |
| 35 | return output |