Merge pull request #6417 from sellout/rpc-tests-interrupt-context
Show in-progress tests when rpc-tests is interrupted
This commit is contained in:
commit
efa2dc70e8
|
@ -334,6 +334,7 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl
|
|||
|
||||
max_len_name = len(max(test_list, key=len))
|
||||
results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "PASSED", "DURATION") + BOLD[0]
|
||||
try:
|
||||
for _ in range(len(test_list)):
|
||||
(name, stdout, stderr, passed, duration) = job_queue.get_next()
|
||||
all_passed = all_passed and passed
|
||||
|
@ -345,6 +346,12 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl
|
|||
print("Pass: %s%s%s, Duration: %s s\n" % (BOLD[1], passed, BOLD[0], duration))
|
||||
|
||||
results += "%s | %s | %s s\n" % (name.ljust(max_len_name), str(passed).ljust(6), duration)
|
||||
except (InterruptedError, KeyboardInterrupt):
|
||||
print('\nThe following tests were running when interrupted:')
|
||||
for j in job_queue.jobs:
|
||||
print("•", j[0])
|
||||
print('\n', end='')
|
||||
raise
|
||||
|
||||
results += BOLD[1] + "\n%s | %s | %s s (accumulated)" % ("ALL".ljust(max_len_name), str(all_passed).ljust(6), time_sum) + BOLD[0]
|
||||
print(results)
|
||||
|
|
Loading…
Reference in New Issue