Skip to content

Commit 01fad9f

Browse files
committed
contest: allow two numbers in KTAP
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 96523ba commit 01fad9f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

contest/remote/lib/results.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def guess_indicators(output):
1717
return {
1818
"fail": output.find("[FAIL]") != -1 or output.find("[fail]") != -1 or
1919
output.find(" FAIL:") != -1 or
20-
output.find("\nnot ok 1 selftests: ") != -1 or
20+
bool(re.search(r"\nnot ok \d+( \d+)? selftests: ", output)) or
2121
output.find("\n# not ok 1") != -1,
2222
"skip": output.find("[SKIP]") != -1 or output.find("[skip]") != -1 or
2323
output.find(" # SKIP") != -1 or output.find("SKIP:") != -1,
2424
"pass": output.find("[OKAY]") != -1 or output.find("[PASS]") != -1 or
2525
output.find("[ OK ]") != -1 or output.find("[OK]") != -1 or
2626
output.find("[ ok ]") != -1 or output.find("[pass]") != -1 or
2727
output.find("PASSED all ") != -1 or
28-
output.find("\nok 1 selftests: ") != -1 or
28+
bool(re.search(r"\nok \d+( \d+)? selftests: ", output)) or
2929
bool(re.search(
3030
r"# Totals: pass:[1-9]\d* fail:0 (xfail:0 )?(xpass:0 )?skip:0 error:0",
3131
output)),
@@ -62,7 +62,7 @@ def parse_nested_tests(full_run, namify_fn, prev_results=None):
6262
nested_tests = False
6363

6464
result_re = re.compile(
65-
r"(not )?ok (\d+)( -)? ([^#]*[^ ])( +# +)?([^ ].*)?$")
65+
r"(not )?ok (\d+)( \d+)?( -)? ([^#]*[^ ])( +# +)?([^ ].*)?$")
6666
time_re = re.compile(r"time=(\d+)ms")
6767

6868
for line in full_run.split('\n'):
@@ -87,13 +87,13 @@ def parse_nested_tests(full_run, namify_fn, prev_results=None):
8787
continue
8888

8989
v = result_re.match(line).groups()
90-
r = {'test': namify_fn(v[3])}
90+
r = {'test': namify_fn(v[4])}
9191

92-
if len(v) > 5 and v[4] and v[5]:
93-
if v[5].lower().startswith('skip'):
92+
if len(v) > 6 and v[5] and v[6]:
93+
if v[6].lower().startswith('skip'):
9494
result = "skip"
9595

96-
t = time_re.findall(v[5].lower())
96+
t = time_re.findall(v[6].lower())
9797
if t:
9898
r['time'] = round(int(t[-1]) / 1000.) # take the last one
9999

0 commit comments

Comments
 (0)