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

Unified Diff: PRESUBMIT.py

Issue 1129443005: Add presubmit to run `{dm,nanobench}_flags.py test` when changed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: python Created 5 years, 7 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/dm_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 60439d6eb020641172b427c840bd3518211174c2..6d429dfa1c1ac4116763e36b75641bede6189b45 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -140,6 +140,17 @@ def _CopyrightChecks(input_api, output_api, source_file_filter=None):
return results
+def _ToolFlags(input_api, output_api):
+ """Make sure `{dm,nanobench}_flags.py test` passes if modified."""
+ results = []
+ sources = lambda x: ('dm_flags.py' in x.LocalPath() or
+ 'nanobench_flags.py' in x.LocalPath())
+ for f in input_api.AffectedSourceFiles(sources):
+ if 0 != subprocess.call(['python', f.LocalPath(), 'test']):
+ results.append(output_api.PresubmitError('`python %s test` failed' % f))
+ return results
+
+
def _CommonChecks(input_api, output_api):
"""Presubmit checks common to upload and commit."""
results = []
@@ -161,6 +172,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_IfDefChecks(input_api, output_api))
results.extend(_CopyrightChecks(input_api, output_api,
source_file_filter=sources))
+ results.extend(_ToolFlags(input_api, output_api))
return results
« no previous file with comments | « no previous file | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698