From 4494a24a8a05e600a479f314eae96901d580c958 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Mon, 3 Dec 2012 21:45:43 +0100 Subject: [PATCH] Handle args to IN-SUITE* the same as in DEF-SUITE. --- src/suite.lisp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/suite.lisp b/src/suite.lisp index 345a090..59fe844 100644 --- a/src/suite.lisp +++ b/src/suite.lisp @@ -105,18 +105,21 @@ will be created (as per DEF-SUITE)" :fail-on-error nil ,@def-suite-args)) -(defmacro %in-suite (suite-name &rest def-suite-args &key fail-on-error &allow-other-keys) - (declare (ignore fail-on-error)) - (with-gensyms (suite) - (let ((fail-on-error (getf def-suite-args :fail-on-error t))) - (remf def-suite-args :fail-on-error) +(defmacro %in-suite (suite-name + &key description (in nil in-p) (fixture nil fixture-p) + (fail-on-error t)) + (let ((def-suite-args + `(,@(when description `(:description ,description)) + ,@(when in-p `(:in ',in)) + ,@(when fixture-p `(:fixture ',fixture))))) + (with-gensyms (suite) `(progn (if-let (,suite (get-test ',suite-name)) (setf *suite* ,suite) (progn - (when ,fail-on-error - (cerror "Create a new suite named ~A." - "Unknown suite ~A." ',suite-name)) + ,@(when fail-on-error + `((cerror "Create a new suite named ~A." + "Unknown suite ~A." ',suite-name))) (setf (get-test ',suite-name) (make-suite ',suite-name ,@def-suite-args) *suite* (get-test ',suite-name)))) ',suite-name)))) -- 1.7.10.4