Unit testing 为什么';t clojure.test/run-all-tests从leiningen插件运行时是否查找测试?
我有一个leiningen插件,包含以下功能:Unit testing 为什么';t clojure.test/run-all-tests从leiningen插件运行时是否查找测试?,unit-testing,plugins,clojure,leiningen,Unit Testing,Plugins,Clojure,Leiningen,我有一个leiningen插件,包含以下功能: (defn vscode-test "Simple test run" [project & args] (leiningen.core.eval/eval-in-project project `(clojure.test/run-all-tests))) 当我在Clojure项目中使用project.cljfileClojure.test/run所有测试运行时,lein-vscode-test会运行,但在项目中找不到任何测
(defn vscode-test
"Simple test run"
[project & args]
(leiningen.core.eval/eval-in-project project `(clojure.test/run-all-tests)))
当我在Clojure项目中使用project.clj
fileClojure.test/run所有测试运行时,lein-vscode-test
会运行,但在项目中找不到任何测试。请注意,lein test
确实运行所有测试
我的project.clj
是
(defproject repl_test "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:source-paths ["src" "test" "dev"]
:plugins [[vscode-test "0.1.0-SNAPSHOT"]]
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/core.async "0.3.442"]
[org.clojure/tools.namespace "0.2.11"]])
为什么插件看不到测试
clojure.测试/运行所有测试
运行所有当前定义的测试lein test
首先在test
目录中加载测试定义,然后调用clojure.test
代码
换言之;您没有运行任何测试,因为您提供的代码不加载/不需要包含测试的命名空间。我认为如果您在问题中包含
project.clj
内容会有所帮助。添加了project.clj这很有意义。我假设运行所有测试
都会加载它们,但它只有在已经加载的情况下才运行它们才有意义。