Make retest work with test selectors.

This commit is contained in:
Phil Hagelberg 2011-05-12 14:27:20 -04:00
parent 4a3a5f0a45
commit 43f8cac4a7

View file

@ -5,9 +5,10 @@
(defn retest
"Run only the test namespaces which failed last time around.
Requires loading leiningen.hooks.retest to :hooks in project.clj."
[project]
[project & selectors]
;; TODO: detect branch change; clear failure list
(if (.exists (java.io.File. ".lein-failures"))
(apply leiningen.test/test project (->> (slurp ".lein-failures")
read-string sort (map name)))
(leiningen.test/test project)))
(apply leiningen.test/test project
(concat (if (.exists (java.io.File. ".lein-failures"))
(->> (slurp ".lein-failures")
read-string sort (map name)))
selectors)))