From: Tim Newsome Date: Mon, 20 Nov 2017 04:54:33 +0000 (-0800) Subject: Ensure log file is fully written before reading it X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=669ac25d0db3888f2c41e3f50344d728be29a701;p=riscv-tests.git Ensure log file is fully written before reading it Fixes --print-failures sometimes not actually printing out details about failures. --- diff --git a/debug/testlib.py b/debug/testlib.py index 90702bf..5fc384a 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -606,6 +606,7 @@ def run_tests(parsed, target, todo): finally: sys.stdout = real_stdout log_fd.write("Time elapsed: %.2fs\n" % (time.time() - start)) + log_fd.flush() print "[%s] %s in %.2fs" % (name, result, time.time() - start) if result not in good_results and parsed.print_failures: sys.stdout.write(open(log_name).read())