aboutsummaryrefslogtreecommitdiff
path: root/tests/run-tests.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-12-30 16:34:04 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-12-30 16:34:04 +0100
commit8779c304895e1e147be50ca29a0968fdfb5c88a3 (patch)
tree99bda119c219dd5837f3dd3d296f1c036c96d25b /tests/run-tests.scm
parentAdd simple benchmark main. (diff)
downloadcalp-8779c304895e1e147be50ca29a0968fdfb5c88a3.tar.gz
calp-8779c304895e1e147be50ca29a0968fdfb5c88a3.tar.xz
Add throw-handler to test runner.
Diffstat (limited to 'tests/run-tests.scm')
-rwxr-xr-xtests/run-tests.scm27
1 files 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")