Remove usage of handler arg in test task.

This commit is contained in:
Phil Hagelberg 2010-11-03 21:58:04 -07:00
parent d88165ae9c
commit b505cba346

View file

@ -6,11 +6,6 @@
[leiningen.compile :only [eval-in-project]]) [leiningen.compile :only [eval-in-project]])
(:import [java.io File])) (:import [java.io File]))
(defn- init-args [java & files]
(doseq [f files]
(.setValue (.createArg java) "-i")
(.setValue (.createArg java) f)))
(defn- form-for-hook-selectors [selectors] (defn- form-for-hook-selectors [selectors]
`(when (seq ~selectors) `(when (seq ~selectors)
(if-let [add-hook# (resolve 'robert.hooke/add-hook)] (if-let [add-hook# (resolve 'robert.hooke/add-hook)]
@ -57,10 +52,9 @@ tests. If none are given, runs them all." ; TODO: update
(throw (Exception. "Args must be either all namespaces or keywords."))) (throw (Exception. "Args must be either all namespaces or keywords.")))
(eval-in-project project (form-for-testing-namespaces (eval-in-project project (form-for-testing-namespaces
nses (.getAbsolutePath result) (vec selectors)) nses (.getAbsolutePath result) (vec selectors))
#(apply init-args % nil nil `(do (require '~'clojure.test)
(if (seq selectors) ~(when (seq selectors)
["@clojure/test.clj" "@robert/hooke.clj"] '(require 'robert.hooke))))
["@clojure/test.clj"])))
(if (and (.exists result) (pos? (.length result))) (if (and (.exists result) (pos? (.length result)))
(let [summary (read-string (slurp (.getAbsolutePath result))) (let [summary (read-string (slurp (.getAbsolutePath result)))
success? (zero? (+ (:error summary) (:fail summary)))] success? (zero? (+ (:error summary) (:fail summary)))]