run-all-tests

added
1.1

ns
clojure.test

type
function

(run-all-tests) (run-all-tests re)

Runs all tests in all namespaces; prints results.
Optional argument is a regular expression; only namespaces with
names matching the regular expression (with re-matches) will be
tested.

                ;; assuming current namespace is user
(use 'clojure.test)
(deftest eg-tests (is (= 1 1)))
(run-all-tests)
;;=> ... visits very many namespaces looking for tests to run
;;=> {:type :summary, :fail 0, :error 0, :pass 1, :test 1}

(run-all-tests #"us.*")  ; only matches "user"
;;=> Testing user
;;=> Ran 1 tests containing 1 assertions.
;;=> 0 failures, 0 errors.
;;=> {:type :summary, :fail 0, :error 0, :pass 1, :test 1}