abedra (owner)

Revisions

gist: 228239 Download_button fork
public
Public Clone URL: git://gist.github.com/228239.git
Embed All Files: show embed
runner.clj #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(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)))