File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 50
50
(alter-meta! var #(-> %
51
51
(assoc :test (::test %))
52
52
(dissoc ::test )))))))
53
-
54
- (defn- require-and-resolve
55
- [sym]
56
- (require (symbol (namespace sym)))
57
- (resolve sym))
58
-
59
53
(defn test
60
54
[options]
61
55
(let [dirs (or (:dir options)
62
56
#{" test" })
63
57
nses (->> dirs
64
58
(map io/file)
65
59
(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)]
71
61
(println (format " \n Running tests in %s" dirs))
72
62
(dorun (map require nses))
73
63
(try
74
64
(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)
79
66
(finally
80
67
(restore-vars! nses)))))
81
68
106
93
[" -e" " --exclude KEYWORD" " Exclude tests with this metadata keyword."
107
94
:parse-fn parse-kw
108
95
: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." ]
112
96
[" -H" " --test-help" " Display this help message" ]])
113
97
114
98
(defn- help
You can’t perform that action at this time.
0 commit comments