diff --git a/test/script-support.lisp b/test/script-support.lisp index d4c83b3afa4e0b388e5eb83fda3ac7e246bbd741..2a8b923636cd154b499d813b2caf5ed7567e7273 100644 --- a/test/script-support.lisp +++ b/test/script-support.lisp @@ -127,7 +127,11 @@ Some constraints: ',sexp ',condition ,x)) (t (,x) (error "Expression ~S raises signal ~S, not ~S" ',sexp ,x ',condition))))) - +(defmacro errors (condition sexp) + `(progn + (format *error-output* "~&Checking whether ~S signals error ~S~%" ',sexp ',condition) + (finish-output *error-output*) + (assert-equal ',condition (type-of (nth-value 1 (ignore-errors ,sexp)))))) ;;; Helpful for debugging (defun pathname-components (p) diff --git a/test/test-deferred-warnings.script b/test/test-deferred-warnings.script index 9580694a1487f8ead0e22ee44b2040f0cf21db9a..ae8f42a202bbeb9a04029655faf7e06c1668ff4a 100644 --- a/test/test-deferred-warnings.script +++ b/test/test-deferred-warnings.script @@ -98,22 +98,13 @@ ;;(t (c) (DBG :ustdf0 c)) (:no-error (&rest values) (DBG :ustdf1 values) nil))) -(assert - (flet ((expected-error (x) - (format t "Expected error type: ~a" (type-of x)) - t)) - (handler-case - (let ((*compile-file-warnings-behaviour* :error)) - (load-system :undefined-variables) - nil) - (compile-failed-error (x) (expected-error x)) - (compile-file-error (x) (expected-error x)) - (error (x) - (format t "Unexpected error type: ~a" (type-of x)) - nil)))) -(assert - (handler-case - (let ((*compile-file-warnings-behaviour* :warning)) - (load-system :undefined-variables :force t) - nil) - (error () t))) +(errors #+(or allegro clozure) compile-file-error + #+(or cmu scl) null + #+sbcl compile-failed-error + (let ((*compile-file-warnings-behaviour* :error)) + (load-system :undefined-variables))) +(errors #+(or allegro clozure) compile-file-error + #+(or cmu scl) null + #+sbcl compile-failed-error + (let ((*compile-file-warnings-behaviour* :warning)) + (load-system :undefined-variables :force t)))