Runs all tests in the given namespaces; prints results.
Defaults to current namespace if none given. Returns a map
summarizing test results.
;run tests from the core namespace (there are no tests in it,though)
;to make tests use (deftest ...)
(run-tests 'clojure.core)
=> Testing clojure.core
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
{:type :summary, :test 0, :pass 0, :fail 0, :error 0}
(defn run-tests
"Runs all tests in the given namespaces; prints results.
Defaults to current namespace if none given. Returns a map
summarizing test results."
{:added "1.1"}
([] (run-tests *ns*))
([& namespaces]
(let [summary (assoc (apply merge-with + (map test-ns namespaces))
:type :summary)]
(do-report summary)
summary)))
Comments top
1 comment(s) for run-tests.
If you don't specify any namespaces, the current namespace is used.