I'm trying to to use asdf's functionality to run my test suite from the repl but when using quicklisps quickload if fails on the first attempt to load foo and success on the second.
(in-package :cl-user)
(defpackage :foo-system
(:use :cl :asdf))
(in-package :foo-system)
(asdf:defsystem :foo
:components ((:file "foo")))
(asdf:defsystem :foo-tests
:depends-on (:foo)
:components ((:file "foo-tests")))
(defmethod asdf:perform ((op test-op) (system (eql (find-system :foo))))
(asdf:load-system 'foo-tests)
(foo-tests:run-tests))
It makes sense because when I compile the asd file the error appears to be in the second form of the asdf:perfom defmethod. The error, replacing nclack by foo, is:
../../nclack/nclack.asd:36:27: read-error: READ error during COMPILE-FILE:
Package NCLACK-TESTS does not exist. Line: 36, Column: 27, File-Position: 1034 Stream: #<SB-SYS:FD-STREAM for "file /Users/PuercoPop/quicklisp/local-projects/nclack/nclack.asd" {1005DB11A3}>
which matches the (foo-tests:run-tests) line. So it appears to be that 'loading' a system is different from compiling its forms? Or why is the package not defined after loading the system? Any ideas? I'm at a loss.
find-system
is a function inasdf
namespace. The same goes fortest-op
. That shouldn't compile otherwise / unless you had those symbols declared in a package which was current at the compilation time. – user797257