Skip to content
Snippets Groups Projects
Commit 9575fb8d authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Make the undefined-variables test more portable.

parent 02281587
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,11 @@ Some constraints: ...@@ -127,7 +127,11 @@ Some constraints:
',sexp ',condition ,x)) ',sexp ',condition ,x))
(t (,x) (t (,x)
(error "Expression ~S raises signal ~S, not ~S" ',sexp ,x ',condition))))) (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 ;;; Helpful for debugging
(defun pathname-components (p) (defun pathname-components (p)
......
...@@ -98,22 +98,13 @@ ...@@ -98,22 +98,13 @@
;;(t (c) (DBG :ustdf0 c)) ;;(t (c) (DBG :ustdf0 c))
(:no-error (&rest values) (DBG :ustdf1 values) nil))) (:no-error (&rest values) (DBG :ustdf1 values) nil)))
(assert (errors #+(or allegro clozure) compile-file-error
(flet ((expected-error (x) #+(or cmu scl) null
(format t "Expected error type: ~a" (type-of x)) #+sbcl compile-failed-error
t)) (let ((*compile-file-warnings-behaviour* :error))
(handler-case (load-system :undefined-variables)))
(let ((*compile-file-warnings-behaviour* :error)) (errors #+(or allegro clozure) compile-file-error
(load-system :undefined-variables) #+(or cmu scl) null
nil) #+sbcl compile-failed-error
(compile-failed-error (x) (expected-error x)) (let ((*compile-file-warnings-behaviour* :warning))
(compile-file-error (x) (expected-error x)) (load-system :undefined-variables :force t)))
(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)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment