Skip to content

Commit af3c252

Browse files
committed
Allow to test row and column.
1 parent 89ac126 commit af3c252

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

testsuite/support.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,32 @@ def __init__(self, options):
2525
super(TestReport, self).__init__(options)
2626
self._verbose = options.verbose
2727

28+
def error(self, line_number, offset, text, check):
29+
"""Report an error, according to options."""
30+
code = text[:4]
31+
if code in self.counters:
32+
self.counters[code] += 1
33+
else:
34+
self.counters[code] = 1
35+
detailed_code = '%s:%s:%s' % (code, line_number, offset + 1)
36+
# Don't care about expected errors or warnings
37+
if code in self.expected or detailed_code in self.expected:
38+
return
39+
self._deferred_print.append(
40+
(line_number, offset, detailed_code, text[5:], check.__doc__))
41+
self.file_errors += 1
42+
self.total_errors += 1
43+
return code
44+
2845
def get_file_results(self):
2946
# Check if the expected errors were found
3047
label = '%s:%s:1' % (self.filename, self.line_offset)
31-
for code in self.expected:
48+
for extended_code in self.expected:
49+
code = extended_code.split(':')[0]
3250
if not self.counters.get(code):
3351
self.file_errors += 1
3452
self.total_errors += 1
35-
print('%s: error %s not found' % (label, code))
53+
print('%s: error %s not found' % (label, extended_code))
3654
else:
3755
self.counters[code] -= 1
3856
for code, extra in sorted(self.counters.items()):
@@ -50,7 +68,6 @@ def get_file_results(self):
5068
self.counters['test cases'] += 1
5169
if self.file_errors:
5270
self.counters['failed tests'] += 1
53-
self.messages = {}
5471
return super(TestReport, self).get_file_results()
5572

5673
def print_results(self):
@@ -93,7 +110,6 @@ def selftest(options):
93110
# Keep showing errors for multiple tests
94111
for key in set(counters) - set(options.benchmark_keys):
95112
del counters[key]
96-
report.messages = {}
97113
count_all += 1
98114
if not error:
99115
if options.verbose:

0 commit comments

Comments
 (0)