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