OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """ | 10 """ |
11 Copied from Chrome's src/tools/valgrind/memcheck/PRESUBMIT.py | 11 Copied from Chrome's src/tools/valgrind/memcheck/PRESUBMIT.py |
12 | 12 |
13 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 13 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
14 for more details on the presubmit API built into gcl. | 14 for more details on the presubmit API built into gcl. |
15 """ | 15 """ |
16 | 16 |
17 import os | 17 import os |
18 import re | 18 import re |
19 import sys | 19 import sys |
20 | 20 |
21 def CheckChange(input_api, output_api): | 21 def CheckChange(input_api, output_api): |
22 """Checks the memcheck suppressions files for bad data.""" | 22 """Checks the memcheck suppressions files for bad data.""" |
23 | 23 |
24 # Add the path to the Chrome valgrind dir to the import path: | 24 # Add the path to the Chrome valgrind dir to the import path: |
25 tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..', '..', | 25 tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..', '..', '..', |
26 'valgrind') | 26 'tools', 'valgrind') |
27 sys.path.append(tools_vg_path) | 27 sys.path.append(tools_vg_path) |
28 import suppressions | 28 import suppressions |
29 | 29 |
30 sup_regex = re.compile('suppressions.*\.txt$') | 30 sup_regex = re.compile('suppressions.*\.txt$') |
31 suppressions = {} | 31 suppressions = {} |
32 errors = [] | 32 errors = [] |
33 check_for_memcheck = False | 33 check_for_memcheck = False |
34 # skip_next_line has 3 possible values: | 34 # skip_next_line has 3 possible values: |
35 # - False: don't skip the next line. | 35 # - False: don't skip the next line. |
36 # - 'skip_suppression_name': the next line is a suppression name, skip. | 36 # - 'skip_suppression_name': the next line is a suppression name, skip. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 def CheckChangeOnUpload(input_api, output_api): | 91 def CheckChangeOnUpload(input_api, output_api): |
92 return CheckChange(input_api, output_api) | 92 return CheckChange(input_api, output_api) |
93 | 93 |
94 | 94 |
95 def CheckChangeOnCommit(input_api, output_api): | 95 def CheckChangeOnCommit(input_api, output_api): |
96 return CheckChange(input_api, output_api) | 96 return CheckChange(input_api, output_api) |
97 | 97 |
98 | 98 |
99 def GetPreferredTrySlaves(): | 99 def GetPreferredTrySlaves(): |
100 return ['linux_memcheck'] | 100 return ['linux_memcheck'] |
OLD | NEW |