From 8779c304895e1e147be50ca29a0968fdfb5c88a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 30 Dec 2019 16:34:04 +0100 Subject: Add throw-handler to test runner. --- tests/run-tests.scm | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/run-tests.scm b/tests/run-tests.scm index c024f3a9..613b89df 100755 --- a/tests/run-tests.scm +++ b/tests/run-tests.scm @@ -43,18 +43,23 @@ (format (current-error-port) "Running test ~a~%" fname) (test-group fname - (with-input-from-file (string-append here "/" fname) + (with-throw-handler #t (lambda () - (let ((modules (read))) - (eval-in-sandbox - `(begin ,@(read-multiple)) - #:module (make-sandbox-module - (append modules - '(((srfi srfi-64) test-assert test-equal test-error) - ((ice-9 ports) call-with-input-string) - ((guile) make-struct/no-tail) - ) - all-pure-bindings)))))))) + (with-input-from-file (string-append here "/" fname) + (lambda () + (let ((modules (read))) + (eval-in-sandbox + `(begin ,@(read-multiple)) + #:time-limit 5 ; larger than should be needed + #:module (make-sandbox-module + (append modules + '(((srfi srfi-64) test-assert test-equal test-error) + ((ice-9 ports) call-with-input-string) + ((guile) make-struct/no-tail) + ) + all-pure-bindings))))))) + (lambda args (format (current-error-port) + "Test really crashed: ~a~%" args) )))) (test-end "tests") -- cgit v1.2.3