make lein test print ns-specific commands that can be copied and pasted

This commit is contained in:
Justin Balthrop 2012-04-24 14:35:36 -07:00
parent 5a1c2419da
commit 7a77786248

View file

@ -31,12 +31,15 @@
;; TODO: fall back for :disable-injected? already pretty hairy =\
_# (leiningen.core.injected/add-hook
#'clojure.test/report
(fn report-with-failures [report# m# & args#]
(fn [report# m# & args#]
(when (#{:error :fail} (:type m#))
(swap! failures# conj
(-> clojure.test/*testing-vars*
first meta :ns ns-name)))
(apply report# m# args#)))
(if (= :begin-test-ns (:type m#))
(clojure.test/with-test-out
(println "\nlein test" (ns-name (:ns m#))))
(apply report# m# args#))))
summary# (binding [clojure.test/*test-out* *out*]
(apply ~'clojure.test/run-tests '~namespaces))]
(spit ".lein-failures" (pr-str @failures#))