Skip to content

Commit 784636a

Browse files
committed
1 parent 365e145 commit 784636a

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/cognitect/test_runner.clj

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,19 @@
5050
(alter-meta! var #(-> %
5151
(assoc :test (::test %))
5252
(dissoc ::test)))))))
53-
54-
(defn- require-and-resolve
55-
[sym]
56-
(require (symbol (namespace sym)))
57-
(resolve sym))
58-
5953
(defn test
6054
[options]
6155
(let [dirs (or (:dir options)
6256
#{"test"})
6357
nses (->> dirs
6458
(map io/file)
6559
(mapcat find/find-namespaces-in-dir))
66-
nses (filter (ns-filter options) nses)
67-
with-output (require-and-resolve
68-
(:with-output options 'clojure.test/with-test-out))]
69-
(when (not with-output)
70-
(throw (ex-info "Specified with-output not found" {})))
60+
nses (filter (ns-filter options) nses)]
7161
(println (format "\nRunning tests in %s" dirs))
7262
(dorun (map require nses))
7363
(try
7464
(filter-vars! nses (var-filter options))
75-
(binding [test/*test-out* (if (:output options)
76-
(java.io.FileWriter. (:output options))
77-
test/*test-out*)]
78-
(eval `(~with-output (apply test/run-tests (quote ~nses)))))
65+
(apply test/run-tests nses)
7966
(finally
8067
(restore-vars! nses)))))
8168

@@ -106,9 +93,6 @@
10693
["-e" "--exclude KEYWORD" "Exclude tests with this metadata keyword."
10794
:parse-fn parse-kw
10895
:assoc-fn accumulate]
109-
["-w" "--with-output SYMBOL" "Symbol indicating the with output wrapper. Defaults to clojure.test/with-output."
110-
:parse-fn symbol]
111-
["-o" "--output STRING" "String indicating file path to write test output to."]
11296
["-H" "--test-help" "Display this help message"]])
11397

11498
(defn- help

0 commit comments

Comments
 (0)