[email protected] | e615e9c | 2012-03-07 21:39:00 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Top-level presubmit script for testing. |
| 6 | |
tfarina | 78bb92f4 | 2015-01-31 00:20:48 | [diff] [blame] | 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details on the presubmit API built into depot_tools. |
[email protected] | e615e9c | 2012-03-07 21:39:00 | [diff] [blame] | 9 | """ |
| 10 | |
| 11 | |
| 12 | def CommonChecks(input_api, output_api): |
| 13 | output = [] |
Ilia Samsonov | a0083530 | 2019-04-19 17:37:59 | [diff] [blame] | 14 | output.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
| 15 | input_api, output_api, '.', [r'^.+_unittest\.py$'])) |
[email protected] | e615e9c | 2012-03-07 21:39:00 | [diff] [blame] | 16 | output.extend(input_api.canned_checks.RunPylint( |
Ben Pastene | 4b514ab | 2020-09-16 01:07:13 | [diff] [blame] | 17 | input_api, output_api, files_to_skip=[r'gmock.*', r'gtest.*'])) |
[email protected] | e615e9c | 2012-03-07 21:39:00 | [diff] [blame] | 18 | return output |
| 19 | |
| 20 | |
| 21 | def CheckChangeOnUpload(input_api, output_api): |
| 22 | return CommonChecks(input_api, output_api) |
| 23 | |
| 24 | |
| 25 | def CheckChangeOnCommit(input_api, output_api): |
| 26 | return CommonChecks(input_api, output_api) |