aboutsummaryrefslogtreecommitdiff
path: root/module/hnh/test/testrunner.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-09 13:09:08 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-09 13:09:08 +0200
commit3bf6fcb24c3196adcb583f70b724ffed404d2dc1 (patch)
tree9d496ca37fd82e12d8e24c0d740e3f330b291814 /module/hnh/test/testrunner.scm
parentAdd coverage supplement for atomic-*. (diff)
downloadcalp-3bf6fcb24c3196adcb583f70b724ffed404d2dc1.tar.gz
calp-3bf6fcb24c3196adcb583f70b724ffed404d2dc1.tar.xz
Handle crashes in tests!
Unhandled exceptions thrown during tests are now caught, and properly repported. This also allows the tests to run to completion, and print their final summary (which I previously believed was broken when running in multiple threads). Also add --help flag to testrunner...
Diffstat (limited to 'module/hnh/test/testrunner.scm')
-rw-r--r--module/hnh/test/testrunner.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/hnh/test/testrunner.scm b/module/hnh/test/testrunner.scm
index 38df0ee1..b3951c34 100644
--- a/module/hnh/test/testrunner.scm
+++ b/module/hnh/test/testrunner.scm
@@ -6,8 +6,8 @@
:use-module (ice-9 pretty-print)
:use-module (ice-9 format)
:use-module (ice-9 curried-definitions)
- :export (verbose? construct-test-runner)
- )
+ :export (verbose? construct-test-runner
+ test-runner-test-name/description))
(define verbose? (make-parameter #f))
@@ -107,8 +107,12 @@
(with-output-to-string
(lambda ()
(display
- (red (format #f "Test failed: ~a~%"
+ (yellow (format #f "Test failed: ~a~%"
(test-runner-test-name/description runner))))
+ (display
+ (yellow
+ (format #f " Path: ~s~%"
+ (cdr (test-runner-group-path runner)))))
(test-runner-describe-error runner 0)))
err-queue))