Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: LayoutTests/PRESUBMIT.py

Issue 332583002: Add PRESUBMIT checks for not required testharness expected files. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix imports Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Tools/Scripts/check-testharness-expected-pass » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2013 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 """LayoutTests/ presubmit script for Blink.
6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl.
9 """
10
11
12 def _CheckTestharnessResults(input_api, output_api):
13 expected_files = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() i f f.LocalPath().endswith('-expected.txt') and f.Action() != 'D']
14 if len(expected_files) == 0:
15 return []
16
17 checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
18 '..', 'Tools', 'Scripts', 'check-testharness-expected-pass')
19
20 args = [input_api.python_executable, checker_path]
21 args.extend(expected_files)
22 _, errs = input_api.subprocess.Popen(args,
23 stdout=input_api.subprocess.PIPE,
24 stderr=input_api.subprocess.PIPE).communicate()
25 if errs:
26 return [output_api.PresubmitError(errs)]
27 return []
28
29
30 def CheckChangeOnUpload(input_api, output_api):
31 results = []
32 results.extend(_CheckTestharnessResults(input_api, output_api))
33 return results
34
35
36 def CheckChangeOnCommit(input_api, output_api):
37 results = []
38 results.extend(_CheckTestharnessResults(input_api, output_api))
39 return results
OLDNEW
« no previous file with comments | « no previous file | Tools/Scripts/check-testharness-expected-pass » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698