Don't blow up when test eval-in-project doesn't return a number.

Hopefully only an issue when using :eval-in-leiningen.
This commit is contained in:
Phil Hagelberg 2013-03-18 11:17:00 -07:00
parent 4f4e66e01b
commit d54f82695e

View file

@ -174,7 +174,7 @@ specified test. A default :all test-selector is available to run all tests."
form (form-for-testing-namespaces nses nil (vec selectors))] form (form-for-testing-namespaces nses nil (vec selectors))]
(try (when-let [n (eval/eval-in-project project form (try (when-let [n (eval/eval-in-project project form
'(require 'clojure.test))] '(require 'clojure.test))]
(when (pos? n) (when (and (number? n) (pos? n))
(throw (ex-info "Tests Failed" {:exit-code n})))) (throw (ex-info "Tests Failed" {:exit-code n}))))
(catch clojure.lang.ExceptionInfo e (catch clojure.lang.ExceptionInfo e
(main/abort "Tests failed.")))))) (main/abort "Tests failed."))))))