lispci / fiveam

Common Lisp regression testing framework
BSD 3-Clause "New" or "Revised" License
185 stars 31 forks source link

Can't define new top-level suite with def-suite or def-suite* #79

Open rpgoldman opened 3 years ago

rpgoldman commented 3 years ago

The problem is the way that these macros handle their :in keyword argument (https://github.com/lispci/fiveam/blob/0c73f12e1912e847fbb2c70cd482abf5f2b97be1/src/suite.lisp#L36):

(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."
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (make-suite ',name
                 ,@(when description `(:description ,description))
                 ,@(when in `(:in ',in)))
     ',name))

If you explicitly supply :in nil as a way to indicate that you want a top-level suite, the macro will simply discard it. To fix this, we need to have (in nil in-supplied-p) and we need to check in-supplied-p and not in in the when form.

I could make a merge request, but would like to know that it would be accepted (assuming it's a good MR) before bothering.