OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # suppressions.py | 6 # suppressions.py |
7 | 7 |
8 """Post-process Valgrind suppression matcher. | 8 """Post-process Valgrind suppression matcher. |
9 | 9 |
10 Suppressions are defined as follows: | 10 Suppressions are defined as follows: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if line == ELLIPSIS: | 53 if line == ELLIPSIS: |
54 re_line += re.escape(re_bucket) | 54 re_line += re.escape(re_bucket) |
55 re_bucket = '' | 55 re_bucket = '' |
56 re_line += '(.*\n)*' | 56 re_line += '(.*\n)*' |
57 else: | 57 else: |
58 for char in line: | 58 for char in line: |
59 if char == '*': | 59 if char == '*': |
60 re_line += re.escape(re_bucket) | 60 re_line += re.escape(re_bucket) |
61 re_bucket = '' | 61 re_bucket = '' |
62 re_line += '.*' | 62 re_line += '.*' |
| 63 elif char == '?': |
| 64 re_line += re.escape(re_bucket) |
| 65 re_bucket = '' |
| 66 re_line += '.' |
63 else: # there can't be any '\*'s in a stack trace | 67 else: # there can't be any '\*'s in a stack trace |
64 re_bucket += char | 68 re_bucket += char |
65 re_line += re.escape(re_bucket) | 69 re_line += re.escape(re_bucket) |
66 re_bucket = '' | 70 re_bucket = '' |
67 re_line += '\n' | 71 re_line += '\n' |
68 re_line += '(.*\n)*' | 72 re_line += '(.*\n)*' |
69 re_line += '}' | 73 re_line += '}' |
70 self._re = re.compile(re_line, re.MULTILINE) | 74 self._re = re.compile(re_line, re.MULTILINE) |
71 | 75 |
72 def Match(self, suppression_from_report): | 76 def Match(self, suppression_from_report): |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 TestStack(test_stack1, positive_memcheck_suppressions, | 274 TestStack(test_stack1, positive_memcheck_suppressions, |
271 negative_memcheck_suppressions) | 275 negative_memcheck_suppressions) |
272 TestStack(test_stack2, positive_heapcheck_suppressions, | 276 TestStack(test_stack2, positive_heapcheck_suppressions, |
273 negative_heapcheck_suppressions) | 277 negative_heapcheck_suppressions) |
274 TestStack(test_stack3, positive_tsan_suppressions, | 278 TestStack(test_stack3, positive_tsan_suppressions, |
275 negative_tsan_suppressions) | 279 negative_tsan_suppressions) |
276 | 280 |
277 if __name__ == '__main__': | 281 if __name__ == '__main__': |
278 SelfTest() | 282 SelfTest() |
279 print 'PASS' | 283 print 'PASS' |
OLD | NEW |