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

Unified Diff: Tools/Scripts/check-testharness-expected-pass

Issue 332583002: Add PRESUBMIT checks for not required testharness expected files. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ignore deleted files Created 6 years, 6 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
Index: Tools/Scripts/check-testharness-expected-pass
diff --git a/Tools/Scripts/check-testharness-expected-pass b/Tools/Scripts/check-testharness-expected-pass
new file mode 100755
index 0000000000000000000000000000000000000000..94970c47381d58bdd97c0400501f7df49e5677de
--- /dev/null
+++ b/Tools/Scripts/check-testharness-expected-pass
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+#
+# Copyright 2014 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.
+
+"""Check if a LayoutTest expected file is a passing testharness result.
+
+The intent of this script is to identify expected files that are passing
+testharness.js results. Those files are not needed because the test
+infrastructure will read the output of testharness.js tests if there is no
+expected files."""
+
+
+import fileinput
+import sys
+
+from webkitpy.layout_tests.testharness import testharness_results_checker
+
+paths = []
+
+for path in sys.argv[1:]:
+ content = open(path, 'r').read()
+ if testharness_results_checker.is_testharness_output(content) and \
+ testharness_results_checker.is_testharness_output_passing(content):
+ paths.append(path)
+
+if len(paths) > 0:
+ sys.stderr.write('* The following files are passing testharness results, they should be removed:\n ')
+ sys.stderr.write('\n '.join(paths))
+ sys.stderr.write('\n')
+ sys.exit("ERROR: found passing testharness results.")

Powered by Google App Engine
This is Rietveld 408576698