OLD | NEW |
---|---|
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | |
6 import re | |
7 import sys | |
8 | |
5 """ | 9 """ |
6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 10 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
7 for more details on the presubmit API built into gcl. | 11 for more details on the presubmit API built into gcl. |
8 """ | 12 """ |
9 | 13 |
14 def CheckChange(input_api, output_api): | |
15 """Checks the TSan suppressions files for bad suppressions.""" | |
16 | |
17 # TODO(timurrrr): find out how to do relative imports | |
18 # and remove this ugly hack. | |
19 tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..') | |
20 sys.path.append(tools_vg_path) | |
21 import suppressions | |
22 | |
23 sup_regex = re.compile('suppressions.*\.txt$') | |
24 errors = suppressions.PresubmitCheck( | |
25 [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.
| |
26 if sup_regex.search(f.LocalPath())]) | |
27 | |
28 return [output_api.PresubmitError(str(e)) for e in errors] | |
29 | |
30 def CheckChangeOnUpload(input_api, output_api): | |
31 return CheckChange(input_api, output_api) | |
32 | |
33 def CheckChangeOnCommit(input_api, output_api): | |
34 return CheckChange(input_api, output_api) | |
35 | |
10 def GetPreferredTrySlaves(): | 36 def GetPreferredTrySlaves(): |
11 return ['linux_tsan'] | 37 return ['linux_tsan'] |
OLD | NEW |