What I really want is the in-source tests definitions:
Let's suppose I have an asdf system:
(defsystem simple-system
:serial t
:components ((:module "src"
:components
((:file "0-package")
(:file "1-tests-stubs")
(:file "2-code") ...))))
And another system to test the first:
(defsystem simple-system-tests
:serial t
:components ((:module "src"
:components
((:file "0-package")
(:file "1-tests-real")
(:file "2-code") ...))))
The only difference between them is that in the simple-system
I have 1-tests-stubs
where in the simple-system-tests
I have 1-tests-real
.
In 1-tests-stubs
I define a macro (defmacro def-test (&rest _args) nil)
which gets a 'real' implementation in the 1-tests-real
.
Now I want to compile the simple-system
with (declare (optimize (safety 0) (debug 0) (speed 3)))
and the simple-system-tests
with the opposite (declare (optimize (safety 3) (debug 3) (speed 0)))
.
How can I do that(where to put and how to set these declarations in a generic way for these two systems)?
How can I reuse the definition of simple-system
in the simple-system-tests
(not to repeat myself retyping all modules/components)?
And I must be sure that all files are recompiled with different optimization levels for each system.
Also, it would be great if for each system files will be recompiled only if they were changed(Own copy of compiled files for each system?).