diff options
| author | Tim Newsome <tim@sifive.com> | 2017-08-11 14:13:41 -0700 |
|---|---|---|
| committer | Tim Newsome <tim@sifive.com> | 2017-08-11 14:13:41 -0700 |
| commit | e31bdb1d210ed0f6f87a578bf16c97a94be192c4 (patch) | |
| tree | 4fd2ed424c52482b43bdc75da8acddc2018ffc12 /debug/testlib.py | |
| parent | 68d65fa9a44885bbe8d93673655e8c5ad98ed628 (diff) | |
| download | riscv-tests-e31bdb1d210ed0f6f87a578bf16c97a94be192c4.zip riscv-tests-e31bdb1d210ed0f6f87a578bf16c97a94be192c4.tar.gz riscv-tests-e31bdb1d210ed0f6f87a578bf16c97a94be192c4.tar.bz2 | |
When make fails to run a test, print out the log.
Diffstat (limited to 'debug/testlib.py')
| -rw-r--r-- | debug/testlib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py index 597c69b..ee1364d 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -428,6 +428,8 @@ def run_tests(parsed, target, todo): sys.stdout = real_stdout log_fd.write("Time elapsed: %.2fs\n" % (time.time() - start)) print "%s in %.2fs" % (result, time.time() - start) + if result not in good_results and parsed.print_failures: + sys.stdout.write(file(log_name).read()) sys.stdout.flush() results.setdefault(result, []).append(name) count += 1 @@ -448,11 +450,12 @@ def print_results(results): return result def add_test_run_options(parser): - parser.add_argument("--logs", default="logs", help="Store logs in the specified directory.") parser.add_argument("--fail-fast", "-f", action="store_true", help="Exit as soon as any test fails.") + parser.add_argument("--print-failures", action="store_true", + help="When a test fails, print the log file to stdout.") parser.add_argument("test", nargs='*', help="Run only tests that are named here.") parser.add_argument("--gdb", |
