Skip to content

Commit ffb033a

Browse files
ajtownslaanwj
authored andcommitted
test: List any failed tests at the end of test_runner output
Change sorting output to put failed tests at the end of test_runner output.
1 parent f92541f commit ffb033a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/functional/test_runner.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, tmpdir, jobs=1, enable_cove
367367
def print_results(test_results, max_len_name, runtime):
368368
results = "\n" + BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "STATUS ", "DURATION") + BOLD[0]
369369

370-
test_results.sort(key=lambda result: result.name.lower())
370+
test_results.sort(key=TestResult.sort_key)
371371
all_passed = True
372372
time_sum = 0
373373

@@ -459,6 +459,14 @@ def __init__(self, name, status, time):
459459
self.time = time
460460
self.padding = 0
461461

462+
def sort_key(self):
463+
if self.status == "Passed":
464+
return 0, self.name.lower()
465+
elif self.status == "Failed":
466+
return 2, self.name.lower()
467+
elif self.status == "Skipped":
468+
return 1, self.name.lower()
469+
462470
def __repr__(self):
463471
if self.status == "Passed":
464472
color = BLUE

0 commit comments

Comments
 (0)