       (System/exit 1)
       (System/exit 0))))
 
+(defn options->prioritizer [options]
+  (cond
+    (and (nil? (:prioritizer options)) (nil? (:priority options)))
+    smart-prioritize-tests
+
+    (:prioritizer options)
+    (:prioritizer options)
+
+    (= (:priority options) :agony)
+    smart-prioritize-tests
+
+    (= (:priority options) :random)
+    shuffle
+
+    (= (:priority options) :gathered)
+    identity))
+
 (defn validate-options [options]
   (assert (and (number? (:slow-test-count options 10)) (pos? (:slow-test-count options 10))) (str ":slow-test-count should be a positive number, but was: " (pr-str (:slow-test-count options 10))))
   (assert (and (number? (:warn-on-slow-test-limit-ms options 1000)) (pos? (:warn-on-slow-test-limit-ms options 1000))) (str ":warn-on-slow-test-limit-ms should be a positive number, but was: " (pr-str (:warn-on-slow-test-limit-ms options 1000))))

(defn default-pharrallelism []
  (.. Runtime getRuntime availableProcessors))

(defn run-tests
  ([ns-re] (run-tests ns-re (default-pharrallelism)))
  ([ns-re pharrallelism]
   (-> (gather-tests ns-re)
     deref
     prioritize-tests
     pour-tests-to-queue
     (run-gathered-tests pharrallelism))))

;; clojure.test monkey punching
(defmethod clojure.test/assert-expr '= [msg [_ a & more]]

       (clear-screen options)
       (let [f (start-flusher (:flush-interval options 10))
             t0 (System/nanoTime)
             test-run (run-tests ns-re (:parallelism options (default-pharrallelism)) (options->prioritizer options))
             t1 (System/nanoTime)
             results {:test-run test-run
                      :test-runner-state (if *test-runner-state* @*test-runner-state*)
