Created
April 17, 2010 03:53
-
-
Save slyphon/369247 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns user | |
(:use | |
[clojure.contrib | |
(logging :only (debug info warn error fatal spy)) | |
[str-utils :only (re-gsub)] | |
[duck-streams :only (to-byte-array)] | |
[java-utils :only (set-system-properties as-properties read-properties)] | |
[pprint :only (pprint pp)]]) | |
(:require | |
[clojure | |
[test :as test] | |
[xml :as xml] | |
[zip :as zip]] | |
[clojure.contrib | |
[lazy-xml :as lxml]] | |
[mbox.harpo | |
(errors :as errors) | |
(core :as core) | |
(log :as log)]) | |
) | |
(def #^{:private true} orig-report test/report) | |
(defmulti log-report :type) | |
(defmethod log-report :begin-test-var [m] | |
(test/with-test-out | |
(let [var (:var m)] | |
(info (format "----< %s >----" var))))) | |
(defmethod log-report :default [m] | |
(orig-report m)) | |
(defmacro with-logging-reporter [& body] | |
`(binding [test/report log-report] | |
~@body)) | |
(defn repl-init [] | |
(core/harpo-init) | |
(use '[clojure.contrib [repl-utils :only (show source)]])) | |
(defn run-all-tests [] | |
(repl-init) | |
(with-logging-reporter | |
(test/run-all-tests))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment