(defclass test-case (testable-object)
((test-lambda :initarg :test-lambda :accessor test-lambda
- :documentation "The function to run."))
+ :documentation "The function to run.")
+ (runtime-package :initarg :runtime-package :accessor runtime-package
+ :documentation "By default it stores *package* from the time this test was defined (macroexpanded)."))
(:documentation "A test case is a single, named, collection of
checks.
(abort-test e)
(return-from run-it result-list)))))
(restart-case
- (let ((*readtable* (copy-readtable)))
+ (let ((*readtable* (copy-readtable))
+ (*package* (runtime-package test)))
(funcall (test-lambda test)))
(retest ()
:report (lambda (stream)
`(progn
(setf (get-test ',name) (make-instance 'test-case
:name ',name
+ :runtime-package ,*package*
:test-lambda
(lambda ()
(funcall (compile nil '(lambda () ,@body))))