1.2.0 permalink Arrow_down_16x16
  • (test project & namespaces)
Run the project's tests. Accepts a list of namespaces for which to run all
tests. If none are given, runs them all.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source leiningen/test.clj:40 top

(defn test
  "Run the project's tests. Accepts a list of namespaces for which to run all
tests. If none are given, runs them all."
  [project & namespaces]
  (let [namespaces (if (empty? namespaces)
                     (sort (find-namespaces-in-dir (file (:test-path project))))
                     (map symbol namespaces))
        result (java.io.File/createTempFile "lein" "result")]
    (eval-in-project project
                     (with-version-guard
                       (form-for-testing-namespaces namespaces
                                                    (.getAbsolutePath result))))
    (if (and (.exists result) (pos? (.length result)))
      (let [summary (read-string (slurp (.getAbsolutePath result)))
            success? (zero? (+ (:error summary) (:fail summary)))]
        (.delete result)
        (if success? 0 1))
      1)))
Vars in leiningen.test/test: and defn let pos? test
Used in 0 other vars

Comments top

No comments for test. Log in to add a comment.