Chromium Code Reviews| Index: tools/valgrind/tsan/PRESUBMIT.py |
| =================================================================== |
| --- tools/valgrind/tsan/PRESUBMIT.py (revision 114626) |
| +++ tools/valgrind/tsan/PRESUBMIT.py (working copy) |
| @@ -2,10 +2,36 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import os |
| +import re |
| +import sys |
| + |
| """ |
| See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| for more details on the presubmit API built into gcl. |
| """ |
| +def CheckChange(input_api, output_api): |
| + """Checks the TSan suppressions files for bad suppressions.""" |
| + |
| + # TODO(timurrrr): find out how to do relative imports |
| + # and remove this ugly hack. |
| + tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..') |
| + sys.path.append(tools_vg_path) |
| + import suppressions |
| + |
| + sup_regex = re.compile('suppressions.*\.txt$') |
| + errors = suppressions.PresubmitCheck( |
| + [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() |
|
Alexander Potapenko
2011/12/15 13:07:23
Bad indentation, please fix
Timur Iskhodzhanov
2011/12/15 13:17:27
Done.
|
| + if sup_regex.search(f.LocalPath())]) |
| + |
| + return [output_api.PresubmitError(str(e)) for e in errors] |
| + |
| +def CheckChangeOnUpload(input_api, output_api): |
| + return CheckChange(input_api, output_api) |
| + |
| +def CheckChangeOnCommit(input_api, output_api): |
| + return CheckChange(input_api, output_api) |
| + |
| def GetPreferredTrySlaves(): |
| return ['linux_tsan'] |