Rebind *package* also when compiling the tests
[fiveam.git] / src / test.lisp
index ccdcb0a..99bc8bb 100644 (file)
@@ -12,6 +12,7 @@
 ;;;; collection of tests and test suites.
 
 (deflookup-table test
+  :at-redefinition nil
   :documentation "Lookup table mapping test (and test suite)
   names to objects.")
 
@@ -54,9 +55,11 @@ SUITE defaults to the current value of *SUITE*."
       `(progn
         (setf (get-test ',name) (make-instance 'test-case
                                                 :name ',name
+                                                :runtime-package ,*package*
                                                 :test-lambda
                                                 (lambda ()
-                                                  (funcall (compile nil '(lambda () ,@body))))
+                                                  (funcall (let ((*package* ,*package*))
+                                                             (compile nil '(lambda () ,@body)))))
                                                 :description ,description
                                                 :depends-on ',depends-on))
         ,(if suite-supplied-p