• (run-tests)
  • (run-tests & namespaces)
Runs all tests in the given namespaces; prints results.
Defaults to current namespace if none given. Returns a map
summarizing test results.

1 Example top

  • ;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}
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/test.clj:731 top

(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)))
Vars in clojure.contrib.test-is/run-tests: *ns* defn let
Used in 0 other vars

Comments top

1 comment(s) for run-tests.

If you don't specify any namespaces, the current namespace is used.

Log in to add a comment.