((tests :accessor tests :initform (make-hash-table :test 'eql)
:documentation "The hash table mapping names to test
objects in this suite. The values in this hash table
- can be either test-cases or other test-suites.")
- (default-test-args :accessor default-test-args :initform '()
- :initarg :default-test-args
- :documentation "Arguments passed to TEST
- macro when using this suite."))
+ can be either test-cases or other test-suites."))
(:documentation "A test suite is a collection of tests or test suites.
Test suites serve to organize tests into groups so that the
;;;; ** Creating Suits
-(defmacro def-suite (name &key description in default-test-args)
+(defmacro def-suite (name &key description in)
"Define a new test-suite named NAME.
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.
-
-DEFAULT-TEST-ARGS, if provided, will ba passed to the TEST forms
-defined in this suite."
- `(eval-when (:compile-toplevel :load-toplevel :execute)
+named NAME."
+ `(progn
(make-suite ',name
,@(when description `(:description ,description))
- ,@(when in `(:in ',in))
- ,@(when default-test-args `(:default-test-args ,default-test-args)))
+ ,@(when in `(:in ',in)))
',name))
(defmacro def-suite* (name &rest def-suite-args)
(def-suite ,name ,@def-suite-args)
(in-suite ,name)))
-(defun make-suite (name &key description in default-test-args)
+(defun make-suite (name &key description in)
"Create a new test suite object.
Overides any existing suite named NAME."
- (let ((suite (make-instance 'test-suite :name name :default-test-args default-test-args)))
+ (let ((suite (make-instance 'test-suite :name name)))
(when description
(setf (description suite) description))
(loop for i in (ensure-list in)
(when (consp name)
(remf (cdr name) :suite))
(destructuring-bind (name &key depends-on (compile-at :run-time) fixture profile)
- (append (ensure-list name) (default-test-args suite))
+ (ensure-list name)
(declare (type (member :run-time :definition-time) compile-at))
(let ((description (if (stringp (car body))
(pop body)
(in-suite :it.bese.FiveAM)
-(def-suite test-suite
- :description "Suite for tests which should fail."
- :default-test-args '(:fixture null-fixture :compile-at :run-time))
+(def-suite test-suite :description "Suite for tests which should fail.")
(defmacro with-test-results ((results test-name) &body body)
`(let ((,results (with-*test-dribble* nil (run ',test-name))))