Skip to content

Instantly share code, notes, and snippets.

@abedra
Created November 6, 2009 20:01
Show Gist options
  • Save abedra/228239 to your computer and use it in GitHub Desktop.
Save abedra/228239 to your computer and use it in GitHub Desktop.
(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