(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require '[[boot.core :as core]])
  (:import org.junit.runner.JUnitCore))

(deftask junit
  "Run the jUnit test runner."
  []
  (with-pre-wrap fileset
    (let [result (JUnitCore/runClasses
                  (into-array [#_ (magic goes here to find all test classes)]))]
      (when (> (.getFailureCount result) 0)
        (throw (ex-info "There were some test failures." {:result result}))))
    fileset))

(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require '[[boot.core :as core]])
  (:import org.junit.runner.JUnitCore))

(deftask junit
  "Run the jUnit test runner."
  [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
  (with-pre-wrap fileset
    (let [result (JUnitCore/runClasses
                  (into-array [#_ (magic goes here to find all test classes)]))]
      (when (> (.getFailureCount result) 0)
        (throw (ex-info "There were some test failures." {:result result}))))
    fileset))

Add a packages set parameter to the task
Add a packages set parameter to the task

I'm going to follow the lead of adzerk's clojure.test runner and require
the user to specify where to run tests from. The nice thing here is that
they can just specify their base package and then we'll do reflection to
find all of the tests.

RadicalZephyr/boot-junit