projects
/
riscv-tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
68d65fa
)
When make fails to run a test, print out the log.
author
Tim Newsome
<tim@sifive.com>
Fri, 11 Aug 2017 21:13:41 +0000
(14:13 -0700)
committer
Tim Newsome
<tim@sifive.com>
Fri, 11 Aug 2017 21:13:41 +0000
(14:13 -0700)
debug/Makefile
patch
|
blob
|
history
debug/testlib.py
patch
|
blob
|
history
diff --git
a/debug/Makefile
b/debug/Makefile
index d252b550ad6118a260ef41b077f060114905b6f9..2d8d36759d0aac813935b88d88771d9caca8ad32 100644
(file)
--- a/
debug/Makefile
+++ b/
debug/Makefile
@@
-14,9
+14,10
@@
pylint:
spike%:
$(GDBSERVER_PY) \
--isolate \
spike%:
$(GDBSERVER_PY) \
--isolate \
+ --print-failures \
$(src_dir)/targets/RISC-V/$@.py \
--sim_cmd $(RISCV)/bin/$(RISCV_SIM) \
$(src_dir)/targets/RISC-V/$@.py \
--sim_cmd $(RISCV)/bin/$(RISCV_SIM) \
- --server_cmd $(RISCV)/bin/openocd
\
+ --server_cmd $(RISCV)/bin/openocd
clean:
rm -f *.pyc
clean:
rm -f *.pyc
diff --git
a/debug/testlib.py
b/debug/testlib.py
index 597c69bd19cf93931349d43e5b1973323f624043..ee1364de052fcad6f75a684a09b70a87e5a830c4 100644
(file)
--- 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)
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
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):
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("--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",
parser.add_argument("test", nargs='*',
help="Run only tests that are named here.")
parser.add_argument("--gdb",