+;----------------------------------------------------------------------
+; macro def-test-method
+;
+; Creates the representation of a test method (included within a
+; test-case object) and add it to the corresponding suite class.
+; => clos version of the pluggable selector pattern
+;
+; use: (def-test-method test-assert-false (clos-unit-test)
+; (assert-true (eql (+ 1 2) 4) "comment"))
+;
+; new: it calls the textui-test-run function during eval, so to
+; allow the usual lisp-like incremental developing and test.
+;----------------------------------------------------------------------
+
+(defmacro def-test-method (method-name class-name &body method-body)
+ `(let ((,(caar class-name)
+ (make-instance ',(cadar class-name)
+ :name ',method-name)))
+ (setf (method-body ,(caar class-name))
+ #'(lambda() ,@method-body))
+ (add-test (suite ,(caar class-name)) ,(caar class-name))
+ (textui-test-run ,(caar class-name))))
+
+