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

Unified Diff: tools/lsan/PRESUBMIT.py

Issue 956603004: Revert of Remove LSan options/suppressions from test_env.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « testing/test_env.py ('k') | tools/lsan/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lsan/PRESUBMIT.py
diff --git a/tools/lsan/PRESUBMIT.py b/tools/lsan/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b7e971aa79195ce521ab0bb115ad49674a1537a
--- /dev/null
+++ b/tools/lsan/PRESUBMIT.py
@@ -0,0 +1,33 @@
+# Copyright 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.
+
+"""
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details on the presubmit API built into depot_tools.
+"""
+
+import re
+
+def CheckChange(input_api, output_api):
+ errors = []
+
+ for f in input_api.AffectedFiles():
+ if not f.LocalPath().endswith('suppressions.txt'):
+ continue
+ for line_num, line in enumerate(f.NewContents()):
+ line = line.strip()
+ if line.startswith('#') or not line:
+ continue
+ if not line.startswith('leak:'):
+ errors.append('"%s" should be "leak:..." in %s line %d' %
+ (line, f.LocalPath(), line_num))
+ if errors:
+ return [output_api.PresubmitError('\n'.join(errors))]
+ return []
+
+def CheckChangeOnUpload(input_api, output_api):
+ return CheckChange(input_api, output_api)
+
+def CheckChangeOnCommit(input_api, output_api):
+ return CheckChange(input_api, output_api)
« no previous file with comments | « testing/test_env.py ('k') | tools/lsan/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698