def-suite should expand into an (eval-when (:always) ...) not a progn
[fiveam.git] / src / suite.lisp
index e7aab24..14427c6 100644 (file)
@@ -23,12 +23,17 @@ IN (a symbol), if provided, causes this suite te be nested in the
 suite named by IN. NB: This macro is built on top of make-suite,
 as such it, like make-suite, will overrwrite any existing suite
 named NAME."
-  `(progn
+  `(eval-when (:compile-toplevel :load-toplevel :execute)
      (make-suite ',name
-                ,@(when description `(:description ,description))
-                ,@(when in `(:in ',in)))
+                 ,@(when description `(:description ,description))
+                 ,@(when in `(:in ',in)))
      ',name))
 
+(defmacro def-suite* (name &rest def-suite-args)
+  `(progn
+     (def-suite ,name ,@def-suite-args)
+     (in-suite ,name)))
+
 (defun make-suite (name &key description in)
   "Create a new test suite object.
 
@@ -59,7 +64,8 @@ after the execution of this form are, unless specified otherwise,
 in the test-suite named SUITE-NAME.
 
 See also: DEF-SUITE *SUITE*"
-  `(%in-suite ,suite-name))
+  `(eval-when (:compile-toplevel :load-toplevel :execute)
+     (%in-suite ,suite-name)))
 
 (defmacro in-suite* (suite-name &key in)
   "Just like in-suite, but silently creates missing suites."