aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-11-19 20:54:33 -0800
committerTim Newsome <tim@sifive.com>2017-11-19 20:54:33 -0800
commit669ac25d0db3888f2c41e3f50344d728be29a701 (patch)
tree8ff7d0695f548cfd4c77151cca242139721111c6
parent8e0f6a0b1a33d35f2248628af7333ede093341d0 (diff)
downloadriscv-tests-669ac25d0db3888f2c41e3f50344d728be29a701.zip
riscv-tests-669ac25d0db3888f2c41e3f50344d728be29a701.tar.gz
riscv-tests-669ac25d0db3888f2c41e3f50344d728be29a701.tar.bz2
Ensure log file is fully written before reading it
Fixes --print-failures sometimes not actually printing out details about failures.
-rw-r--r--debug/testlib.py1
1 files changed, 1 insertions, 0 deletions
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())