-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: don't throw in test result summary (#588)
Closes #586
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns build-shared | ||
(:refer-clojure :exclude [test]) | ||
(:require | ||
[cognitect.test-runner :as tr])) | ||
|
||
;; private fn pasted from original sources | ||
(defn- do-test | ||
[{:keys [dirs nses patterns vars includes excludes]}] | ||
(let [adapted {:dir (when (seq dirs) (set dirs)) | ||
:namespace (when (seq nses) (set nses)) | ||
:namespace-regex (when (seq patterns) (map re-pattern patterns)) | ||
:var (when (seq vars) (set vars)) | ||
:include (when (seq includes) (set includes)) | ||
:exclude (when (seq excludes) (set excludes))}] | ||
(tr/test adapted))) | ||
|
||
|
||
(defn test | ||
"Reimplement test to not throw but instead exit with 1 on error." | ||
[opts] | ||
(try | ||
(let [{:keys [fail error]} (do-test opts)] | ||
(System/exit (if (zero? (+ fail error)) 0 1))) | ||
(finally | ||
;; Only called if `test` raises an exception | ||
(shutdown-agents)))) |
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
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