summaryrefslogtreecommitdiff
path: root/compojure-3.2/test/run.clj
diff options
context:
space:
mode:
Diffstat (limited to 'compojure-3.2/test/run.clj')
-rwxr-xr-xcompojure-3.2/test/run.clj17
1 files changed, 17 insertions, 0 deletions
diff --git a/compojure-3.2/test/run.clj b/compojure-3.2/test/run.clj
new file mode 100755
index 0000000..a651691
--- /dev/null
+++ b/compojure-3.2/test/run.clj
@@ -0,0 +1,17 @@
+(use 'clojure.contrib.find-namespaces
+ 'clojure.test)
+
+(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)))