我正在尝试在 ASDF 中运行测试,如下所示:
;;;; foo.asd
(defsystem "foo/tests"
:depends-on ("foo"
"fiveam")
:components ((:module "tests"
:components
((:file "main"))))
:perform (test-op (op c) (symbol-call :fiveam '#:run! 'foo/tests:all-tests))
And my tests/main.lisp
文件的开头是这样的:
;;;; tests/main.lisp
(defpackage foo/tests
(:use :cl
:foo
:fiveam)
(:export :#run! :#all-tests))
(in-package :foo/tests)
当我跑步时(asdf:test-system 'foo)
在我的 REPL 中,我被放入调试器中LOAD-SYSTEM-DEFINITION-ERROR
。调试器抱怨说The symbol "ALL-TESTS" is not external in the FOO/TESTS package.
但是,我清楚地导出了符号foo/tests
包裹。有人可以告诉我这里缺少什么以及为什么 Lisp 编译器看不到外部符号吗?非常感谢。
未驻留符号的语法是#:foo
, not :#foo
.
您还需要解析中的符号:perform
运行时形成,例如G。通过uiop:find-symbol*
,就像你使用的一样uiop:symbol-call
there.
:perform (test-op (op c)
(symbol-call :fiveam '#:run!
(find-symbol* '#:all-tests '#:foo/tests)))
或者,因为你似乎导出了run!
测试包中的函数,您可能想调用它而不是fiveam:run!
:
:perform (test-op (op c)
(symbol-call '#:foo/tests '#:run!))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)