blob: 813f568804b3bdb684805c782077b9b16aafd46f [file] [log] [blame]
maruel@chromium.org3d235242009-05-15 12:40:48 +00001#!/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
8See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
9details on the presubmit API built into gcl.
10"""
11
maruel@chromium.orgce30ef72009-05-25 15:20:42 +000012UNIT_TESTS = [
13 'tests.gcl_unittest',
14 'tests.gclient_test',
msb@chromium.orge28e4982009-09-25 20:51:45 +000015 'tests.gclient_scm_test',
maruel@chromium.orgd5800f12009-11-12 20:03:43 +000016 'tests.gclient_utils_test',
maruel@chromium.orgce30ef72009-05-25 15:20:42 +000017 'tests.presubmit_unittest',
18 'tests.revert_unittest',
maruel@chromium.orgd5800f12009-11-12 20:03:43 +000019 'tests.scm_unittest',
maruel@chromium.orgce30ef72009-05-25 15:20:42 +000020 'tests.trychange_unittest',
nirnimesh@chromium.orgb82e4092009-06-18 14:24:08 +000021 'tests.watchlists_unittest',
maruel@chromium.orgce30ef72009-05-25 15:20:42 +000022]
maruel@chromium.org3d235242009-05-15 12:40:48 +000023
24def CheckChangeOnUpload(input_api, output_api):
maruel@chromium.org7b305e82009-05-19 18:24:20 +000025 output = []
26 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api,
27 output_api,
maruel@chromium.orgce30ef72009-05-25 15:20:42 +000028 UNIT_TESTS))
29 return output
30
31
32def CheckChangeOnCommit(input_api, output_api):
33 output = []
34 output.extend(input_api.canned_checks.RunPythonUnitTests(input_api,
35 output_api,
36 UNIT_TESTS))
maruel@chromium.org7b305e82009-05-19 18:24:20 +000037 output.extend(input_api.canned_checks.CheckDoNotSubmit(input_api,
38 output_api))
39 return output