如何為系統定義測試操作
(in-package #:asdf-user)
(defsystem #:foo
:components ((:file "foo"))
:in-order-to ((asdf:test-op (asdf:load-op :foo)))
:perform (asdf:test-op (o c)
(uiop:symbol-call :foo-tests 'run-tests)))
(defsystem #:foo-tests
:name "foo-test"
:components ((:file "tests")))
;; Afterwards to run the tests we type in the REPL
(asdf:test-system :foo)
筆記:
- 我們假設系統 :foo-tests 定義了一個名為“FOO-TESTS” 的包
run-tests
是測試跑步者的切入點- uoip:symbol-call 允許定義一個呼叫尚未讀取的函式的方法。定義系統時,定義函式的包不存在