"Create a test named NAME. If NAME is a list it must be of the
form:
- (name &key depends-on suite fixture compile-at)
+ (name &key depends-on suite fixture compile-at profile)
NAME is the symbol which names the test.
,depends-on), this is accomadate the common case of one test
depending on another.
-FIXTURE specifies a fixtrue to wrap the body in."
-
+FIXTURE specifies a fixtrue to wrap the body in.
+
+If PROFILE is T profiling information will be collected as well."
(let* ((tmp (gensym))
(suite-arg (getf (cdr (ensure-list name)) :suite tmp))
- (suite (cond
- ((eq tmp suite-arg) *suite*)
- (t (get-test suite-arg)))))
+ (suite-form (cond
+ ((eq tmp suite-arg) '*suite*)
+ (t `(get-test ',suite-arg)))))
(when (consp name)
(remf (cdr name) :suite))
- (destructuring-bind (name &key depends-on (compile-at :run-time) fixture)
- (append (ensure-list name) (default-test-args suite))
+ (destructuring-bind (name &key depends-on (compile-at :run-time) fixture profile)
+ (ensure-list name)
(declare (type (member :run-time :definition-time) compile-at))
(let ((description (if (stringp (car body))
(pop body)
,@effective-body))))))
(:definition-time effective-body)))
:description ,description
- :depends-on ',depends-on))
- (setf (gethash ',name (tests ,suite)) ',name)
+ :depends-on ',depends-on
+ :collect-profiling-info ,profile))
+ (setf (gethash ',name (tests ,suite-form)) ',name)
(when *run-test-when-defined*
(run! ',name))
',name)))))