From f92541f7ea66b81343426db0b40f7ba4062df342 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 28 Mar 2018 11:17:36 +0200 Subject: test: Make summary row bold-red if any test failed Make the summary row of the test runner bold red if any test fails. This helps visibility if something fails. --- test/functional/test_runner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 29ec535ca8..427158401d 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -378,7 +378,11 @@ def print_results(test_results, max_len_name, runtime): results += str(test_result) status = TICK + "Passed" if all_passed else CROSS + "Failed" + if not all_passed: + results += RED[1] results += BOLD[1] + "\n%s | %s | %s s (accumulated) \n" % ("ALL".ljust(max_len_name), status.ljust(9), time_sum) + BOLD[0] + if not all_passed: + results += RED[0] results += "Runtime: %s s\n" % (runtime) print(results) -- cgit v1.2.3 From ffb033a6d5d846b19a2b595f7d522d5b73cfca6f Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Wed, 28 Mar 2018 19:55:34 +1000 Subject: 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. --- test/functional/test_runner.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 427158401d..39f1180a45 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -367,7 +367,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, tmpdir, jobs=1, enable_cove def print_results(test_results, max_len_name, runtime): results = "\n" + BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "STATUS ", "DURATION") + BOLD[0] - test_results.sort(key=lambda result: result.name.lower()) + test_results.sort(key=TestResult.sort_key) all_passed = True time_sum = 0 @@ -459,6 +459,14 @@ class TestResult(): self.time = time self.padding = 0 + def sort_key(self): + if self.status == "Passed": + return 0, self.name.lower() + elif self.status == "Failed": + return 2, self.name.lower() + elif self.status == "Skipped": + return 1, self.name.lower() + def __repr__(self): if self.status == "Passed": color = BLUE -- cgit v1.2.3