From 3bf6fcb24c3196adcb583f70b724ffed404d2dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 9 Oct 2023 13:09:08 +0200 Subject: 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... --- module/hnh/test/testrunner.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'module/hnh') 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)) -- cgit v1.2.3