aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml6
-rw-r--r--src/clojure/contrib/datalog/tests/test.clj46
-rw-r--r--src/clojure/contrib/load_all.clj4
-rw-r--r--src/clojure/contrib/test_contrib.clj25
4 files changed, 51 insertions, 30 deletions
diff --git a/build.xml b/build.xml
index 8eb925f4..51aa9efd 100644
--- a/build.xml
+++ b/build.xml
@@ -47,7 +47,8 @@
<path location="${src}"/>
<path location="${clojure.jar}"/>
</classpath>
- <arg value="src/clojure/contrib/test_contrib.clj"/>
+ <arg value="-e"/>
+ <arg value="(require '(clojure.contrib [test-contrib :as main])) (main/run)"/>
</java>
</target>
@@ -60,7 +61,8 @@
<path location="${src}"/>
<path location="${clojure.jar}"/>
</classpath>
- <arg value="src/clojure/contrib/datalog/tests/test.clj"/>
+ <arg value="-e"/>
+ <arg value="(require '(clojure.contrib.datalog.tests [test :as main])) (main/run)"/>
</java>
</target>
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))