X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-util.lisp;h=e49c62763e323321c47aad92ed6b4017ecbf9b5a;hb=134fa6b3f7c5f4bb0652e74227d940a9e7a83563;hp=00a986d5e5cb83eea4c6cf8818d06039276e4377;hpb=175c318c892b0627b36fa3c4db66f59680242204;p=sbcl.git diff --git a/tests/test-util.lisp b/tests/test-util.lisp index 00a986d..e49c627 100644 --- a/tests/test-util.lisp +++ b/tests/test-util.lisp @@ -13,18 +13,21 @@ (defvar *break-on-expected-failure* nil) (defmacro with-test ((&key fails-on name) &body body) - `(handler-case (progn - (start-test) - ,@body - (when (expected-failure-p ,fails-on) - (fail-test :unexpected-success ',name nil))) - (error (error) - (if (expected-failure-p ,fails-on) - (fail-test :expected-failure ',name error) - (fail-test :unexpected-failure ',name error))))) + (let ((block-name (gensym))) + `(block ,block-name + (handler-bind ((error (lambda (error) + (if (expected-failure-p ,fails-on) + (fail-test :expected-failure ',name error) + (fail-test :unexpected-failure ',name error)) + (return-from ,block-name)))) + (progn + (start-test) + ,@body + (when (expected-failure-p ,fails-on) + (fail-test :unexpected-success ',name nil))))))) (defun report-test-status () - (with-standard-io-syntax + (with-standard-io-syntax (with-open-file (stream "test-status.lisp-expr" :direction :output :if-exists :supersede) @@ -36,7 +39,7 @@ (setf *test-count* 0)) (incf *test-count*)) -(defun fail-test (type test-name condition) +(defun fail-test (type test-name condition) (push (list type *test-file* (or test-name *test-count*)) *failures*) (when (or (and *break-on-failure*