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
3 # found in the LICENSE file.
5 """Presubmit script for perf_expectations.
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8 details on the presubmit API built into depot_tools.
11 PERF_EXPECTATIONS
= 'tools/perf_expectations/perf_expectations.json'
12 CONFIG_FILE
= 'tools/perf_expectations/chromium_perf_expectations.cfg'
14 def CheckChangeOnUpload(input_api
, output_api
):
16 for path
in input_api
.LocalPaths():
17 if (PERF_EXPECTATIONS
== path
or CONFIG_FILE
== path
):
22 whitelist
= [r
'.+_unittest\.py$']
23 output
.extend(input_api
.canned_checks
.RunUnitTestsInDirectory(
24 input_api
, output_api
, 'tests', whitelist
))
28 def CheckChangeOnCommit(input_api
, output_api
):
30 for path
in input_api
.LocalPaths():
31 if (PERF_EXPECTATIONS
== path
or CONFIG_FILE
== path
):
36 whitelist
= [r
'.+_unittest\.py$']
37 output
.extend(input_api
.canned_checks
.RunUnitTestsInDirectory(
38 input_api
, output_api
, 'tests', whitelist
))
40 output
.extend(input_api
.canned_checks
.CheckDoNotSubmit(input_api
,