How do common lisp frameworks deal with packages?
Posted: Sun May 24, 2015 9:59 pm
How can one do unit testing in common lisp?
I started with the unit test framework of practical Common Lisp chapter 9.
As I have needed more features, I have been gradually adding them, but my most recent issue is stumping me.
How can I handle packages?
I have several different packages. How can one write a "deftest" that will take an additional argument specifying what package to use?
Every package has many functions that are not exported, so how does a test function in some other "test" package access non-exported symbols?
At first I thought I might be able to do something like:
(defmacro pdeftest (name package parameters &body body)
`(deftest ,name ,parameters :body (prog1 (progn (in-package ,package) ,@body) (in-package test))))
But this doesn't work, and it doesn't look like this is even an approach that could work. Do any of the test frameworks out there work with packages?
I started with the unit test framework of practical Common Lisp chapter 9.
As I have needed more features, I have been gradually adding them, but my most recent issue is stumping me.
How can I handle packages?
I have several different packages. How can one write a "deftest" that will take an additional argument specifying what package to use?
Every package has many functions that are not exported, so how does a test function in some other "test" package access non-exported symbols?
At first I thought I might be able to do something like:
(defmacro pdeftest (name package parameters &body body)
`(deftest ,name ,parameters :body (prog1 (progn (in-package ,package) ,@body) (in-package test))))
But this doesn't work, and it doesn't look like this is even an approach that could work. Do any of the test frameworks out there work with packages?