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

Unified Diff: content/test/gpu/PRESUBMIT.py

Issue 1413883003: Add a presubmit script and pylintrc for content/test/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address kbr's comments Created 5 years, 2 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 | content/test/gpu/gpu_project_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/gpu/PRESUBMIT.py
diff --git a/content/test/gpu/PRESUBMIT.py b/content/test/gpu/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..c490089987a137648883151ff02918b327c45c6c
--- /dev/null
+++ b/content/test/gpu/PRESUBMIT.py
@@ -0,0 +1,57 @@
+# Copyright 2015 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.
+
+def _PyLintChecks(input_api, output_api):
+ pylint_checks = input_api.canned_checks.GetPylint(input_api, output_api,
+ extra_paths_list=_GetPathsToPrepend(input_api), pylintrc='pylintrc')
+ return input_api.RunTests(pylint_checks)
+
+def _GetPathsToPrepend(input_api):
+ current_dir = input_api.PresubmitLocalPath()
+ chromium_src_dir = input_api.os_path.join(current_dir, '..', '..', '..')
+ return [
+ input_api.os_path.join(current_dir, 'gpu_tests'),
+ input_api.os_path.join(chromium_src_dir, 'tools', 'perf'),
+ input_api.os_path.join(chromium_src_dir, 'tools', 'telemetry'),
+ ]
+
+def _WebGLTextExpectationsTests(input_api, output_api):
+ if not input_api.AffectedFiles():
+ return []
+
+ cmd = [
+ input_api.os_path.join(input_api.PresubmitLocalPath(), 'run_unittests.py'),
+ 'gpu_tests',
+ ]
+ if input_api.platform == 'win32':
+ cmd = [input_api.python_executable] + cmd
+
+ if input_api.is_committing:
+ message_type = output_api.PresubmitError
+ else:
+ message_type = output_api.PresubmitPromptWarning
+
+ cmd_name = 'run_content_test_gpu_unittests',
+ test_cmd = input_api.Command(
+ name=cmd_name,
+ cmd=cmd,
+ kwargs={},
+ message=message_type,
+ )
+
+ if input_api.verbose:
+ print 'Running', cmd_name
+ return input_api.RunTests([test_cmd])
+
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+ results.extend(_PyLintChecks(input_api, output_api))
+ results.extend(_WebGLTextExpectationsTests(input_api, output_api))
+ return results
+
+def CheckChangeOnCommit(input_api, output_api):
+ results = []
+ results.extend(_PyLintChecks(input_api, output_api))
+ results.extend(_WebGLTextExpectationsTests(input_api, output_api))
+ return results
« no previous file with comments | « no previous file | content/test/gpu/gpu_project_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698