Skip to content

Instantly share code, notes, and snippets.

@slyphon
Created April 17, 2010 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slyphon/369247 to your computer and use it in GitHub Desktop.
Save slyphon/369247 to your computer and use it in GitHub Desktop.
(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