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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Tools/Scripts/check-testharness-expected-pass » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/PRESUBMIT.py
diff --git a/LayoutTests/PRESUBMIT.py b/LayoutTests/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..93ea7285ba39b8b2a41264dab422d47e3e372e8c
--- /dev/null
+++ b/LayoutTests/PRESUBMIT.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""LayoutTests/ presubmit script for Blink.
+
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details about the presubmit API built into gcl.
+"""
+
+
+def _CheckTestharnessResults(input_api, output_api):
+ expected_files = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if f.LocalPath().endswith('-expected.txt') and f.Action() != 'D']
+ if len(expected_files) == 0:
+ return []
+
+ checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
+ '..', 'Tools', 'Scripts', 'check-testharness-expected-pass')
+
+ args = [input_api.python_executable, checker_path]
+ args.extend(expected_files)
+ _, errs = input_api.subprocess.Popen(args,
+ stdout=input_api.subprocess.PIPE,
+ stderr=input_api.subprocess.PIPE).communicate()
+ if errs:
+ return [output_api.PresubmitError(errs)]
+ return []
+
+
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+ results.extend(_CheckTestharnessResults(input_api, output_api))
+ return results
+
+
+def CheckChangeOnCommit(input_api, output_api):
+ results = []
+ results.extend(_CheckTestharnessResults(input_api, output_api))
+ return results
« 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