aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2018-03-28 19:55:34 +1000
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-28 15:49:55 +0200
commitffb033a6d5d846b19a2b595f7d522d5b73cfca6f (patch)
tree1331c984b2b44d790bcdd654886d0589105a5b11 /test
parentf92541f7ea66b81343426db0b40f7ba4062df342 (diff)
downloadbitcoin-ffb033a6d5d846b19a2b595f7d522d5b73cfca6f.tar.xz
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_runner.py10
1 files changed, 9 insertions, 1 deletions
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