diff options
author | Frantisek Sodomka <fsodomka@gmail.com> | 2009-03-20 11:07:10 +0000 |
---|---|---|
committer | Frantisek Sodomka <fsodomka@gmail.com> | 2009-03-20 11:07:10 +0000 |
commit | 3b4bd7bc6e2fbeb9b7ba698b0dfdd8f5719a4481 (patch) | |
tree | e95870f5d284c6d379d0aa153d29d4160ce21e24 /src/clojure/contrib | |
parent | 0a694e70f36ce6986ec8b21846426ff17d3aabc2 (diff) |
test-contrib and datalog tests behave the same as test-clojure
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r-- | src/clojure/contrib/datalog/tests/test.clj | 46 | ||||
-rw-r--r-- | src/clojure/contrib/load_all.clj | 4 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib.clj | 25 |
3 files changed, 47 insertions, 28 deletions
diff --git a/src/clojure/contrib/datalog/tests/test.clj b/src/clojure/contrib/datalog/tests/test.clj index 101ce098..c649e6b2 100644 --- a/src/clojure/contrib/datalog/tests/test.clj +++ b/src/clojure/contrib/datalog/tests/test.clj @@ -13,25 +13,33 @@ ;; straszheimjeffrey (gmail) ;; Created 11 Feburary 2009 -(ns clojure.contrib.datalog.tests.test.clj - (:use clojure.contrib.test-is)) - -(def tests [:test-util - :test-database - :test-literals - :test-rules - :test-magic - :test-softstrat]) - -(defn test-name - [test] - (symbol (str "clojure.contrib.datalog.tests." (name test)))) - -(doseq [test tests] - (require (test-name test))) - -(apply run-tests (map test-name tests)) - +(ns clojure.contrib.datalog.tests.test + (:use [clojure.contrib.test-is :only (run-tests)]) + (:gen-class)) + +(def test-names [:test-util + :test-database + :test-literals + :test-rules + :test-magic + :test-softstrat]) + +(def test-namespaces + (map #(symbol (str "clojure.contrib.datalog.tests." (name %))) + test-names)) + +(defn run + "Runs all defined tests" + [] + (println "Loading tests...") + (apply require :reload-all test-namespaces) + (apply run-tests test-namespaces)) + +(defn -main + "Run all defined tests from the command line" + [& args] + (run) + (System/exit 0)) ;; End of file diff --git a/src/clojure/contrib/load_all.clj b/src/clojure/contrib/load_all.clj index 6822df01..e5a74b10 100644 --- a/src/clojure/contrib/load_all.clj +++ b/src/clojure/contrib/load_all.clj @@ -33,7 +33,7 @@ accumulators apply-macro auto-agent -;; combinatorics +combinatorics command-line complex-numbers cond @@ -78,6 +78,7 @@ stream-utils template test-is test-is.tests +test-clojure test-clojure.agents test-clojure.atoms test-clojure.control @@ -98,6 +99,7 @@ test-clojure.refs test-clojure.sequences test-clojure.special test-clojure.vars +test-contrib test-contrib.shell-out test-contrib.str-utils trace 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)) |