diff options
Diffstat (limited to 'src/clojure/contrib/test_contrib.clj')
-rw-r--r-- | src/clojure/contrib/test_contrib.clj | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/clojure/contrib/test_contrib.clj b/src/clojure/contrib/test_contrib.clj index ef9d0b3b..8e35e4b9 100644 --- a/src/clojure/contrib/test_contrib.clj +++ b/src/clojure/contrib/test_contrib.clj @@ -13,15 +13,24 @@ ;; stuart.halloway (gmail) (ns clojure.contrib.test-contrib - (:use clojure.contrib.test-is)) + (:use [clojure.contrib.test-is :only (run-tests)]) + (:gen-class)) -(def tests [:complex-numbers :monads :str-utils :shell-out :test-graph :test-dataflow]) +(def test-names [:complex-numbers :monads :str-utils :shell-out :test-graph :test-dataflow]) -(defn test-name - [test] - (symbol (str "clojure.contrib.test-contrib." (name test)))) +(def test-namespaces + (map #(symbol (str "clojure.contrib.test-contrib." (name %))) + test-names)) -(doseq [test tests] - (require (test-name test))) +(defn run + "Runs all defined tests" + [] + (println "Loading tests...") + (apply require :reload-all test-namespaces) + (apply run-tests test-namespaces)) -(apply run-tests (map test-name tests)) +(defn -main + "Run all defined tests from the command line" + [& args] + (run) + (System/exit 0)) |