Created
November 6, 2009 20:01
-
-
Save abedra/228239 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'clojure.contrib.find-namespaces | |
'clojure.test) | |
(def exit-code (atom 0)) | |
(defn find-tests [] | |
(filter | |
#(re-find #"-test" (str %)) (find-namespaces-in-dir (java.io.File. "test")))) | |
(defn require-tests [] | |
(doseq [test (find-tests)] | |
(require test))) | |
(require-tests) | |
(let [results (apply merge-with + (map test-ns (find-tests)))] | |
(if (or (> (results :fail) 0) | |
(> (results :error) 0)) | |
(System/exit -1) | |
(System/exit 0))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment