|
40 | 40 | import os
|
41 | 41 | import re
|
42 | 42 | import subprocess
|
43 |
| -import sys |
44 | 43 | from collections import defaultdict
|
45 | 44 | from json import dumps
|
46 | 45 | from multiprocessing import Pool
|
47 | 46 | from pprint import pformat
|
48 |
| -from time import gmtime, strftime |
49 | 47 |
|
50 | 48 | import argparse
|
| 49 | +import sys |
| 50 | +from time import gmtime, strftime |
51 | 51 |
|
52 | 52 | # global CLI flags
|
53 | 53 | flags = None
|
|
64 | 64 | PTRN_ERROR = re.compile(r'^(?P<error>[A-Z][a-z][a-zA-Z]+):(?P<message>.*)$')
|
65 | 65 | PTRN_UNITTEST = re.compile(r'^#### running: graalpython/lib-python/3/test/(?P<unittest>.*)$')
|
66 | 66 | PTRN_NUM_TESTS = re.compile(r'^Ran (?P<num_tests>\d+) test.*$')
|
67 |
| -PTRN_NUM_ERRORS = re.compile( |
| 67 | +PTRN_FAILED = re.compile( |
68 | 68 | r'^FAILED \((failures=(?P<failures>\d+))?(, )?(errors=(?P<errors>\d+))?(, )?(skipped=(?P<skipped>\d+))?\)$')
|
| 69 | +PTRN_OK = re.compile( |
| 70 | + r'^OK \((failures=(?P<failures>\d+))?(, )?(errors=(?P<errors>\d+))?(, )?(skipped=(?P<skipped>\d+))?\)$') |
69 | 71 | PTRN_JAVA_EXCEPTION = re.compile(r'^(?P<exception>com\.oracle\.[^:]*):(?P<message>.*)')
|
70 | 72 | PTRN_MODULE_NOT_FOUND = re.compile(r'.*ModuleNotFound: \'(?P<module>.*)\'\..*', re.DOTALL)
|
71 | 73 |
|
@@ -169,8 +171,8 @@ def __init__(self):
|
169 | 171 | self.num_skipped = -1
|
170 | 172 |
|
171 | 173 | def all_ok(self):
|
172 |
| - self.num_errors = 0 |
173 | 174 | self.num_fails = 0
|
| 175 | + self.num_errors = 0 |
174 | 176 | self.num_skipped = 0
|
175 | 177 |
|
176 | 178 | @property
|
@@ -212,12 +214,23 @@ def process_output(output_lines):
|
212 | 214 | stats[unittests[-1]].all_ok()
|
213 | 215 | continue
|
214 | 216 |
|
| 217 | + match = re.match(PTRN_OK, line) |
| 218 | + if match: |
| 219 | + fails = match.group('failures') |
| 220 | + errs = match.group('errors') |
| 221 | + skipped = match.group('skipped') |
| 222 | + |
| 223 | + stats[unittests[-1]].num_fails = int(fails) if fails else 0 |
| 224 | + stats[unittests[-1]].num_errors = int(errs) if errs else 0 |
| 225 | + stats[unittests[-1]].num_skipped = int(skipped) if skipped else 0 |
| 226 | + continue |
| 227 | + |
215 | 228 | match = re.match(PTRN_NUM_TESTS, line)
|
216 | 229 | if match:
|
217 | 230 | stats[unittests[-1]].num_tests = int(match.group('num_tests'))
|
218 | 231 | continue
|
219 | 232 |
|
220 |
| - match = re.match(PTRN_NUM_ERRORS, line) |
| 233 | + match = re.match(PTRN_FAILED, line) |
221 | 234 | if match:
|
222 | 235 | fails = match.group('failures')
|
223 | 236 | errs = match.group('errors')
|
|
0 commit comments