Skip to content

Commit

Permalink
Merge pull request #177 from jsuchy/master
Browse files Browse the repository at this point in the history
Adds cloverage support
  • Loading branch information
slagyr authored Mar 22, 2024
2 parents fc7b961 + 3c7ba7d commit b3d367d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ Clone the master branch, build, and run all the tests:
```bash
$ git clone https://github.com/slagyr/speclj.git
$ cd speclj
$ clj -T:build javac
$ clj -M:test:spec
```

Expand All @@ -341,4 +342,4 @@ Post issues on the speclj github project:
# License
Copyright (C) 2010-2023 Micah Martin All Rights Reserved.

Distributed under the The MIT License.
Distributed under the The MIT License.
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
mmargs/mmargs {:mvn/version "1.2.0"}
org.clojure/clojure {:mvn/version "1.11.1"}
trptcolin/versioneer {:mvn/version "0.1.1"}
cloverage/cloverage {:mvn/version "1.2.4"}
}
:aliases {
:test {:extra-deps {
Expand All @@ -25,4 +26,4 @@
:source-uri "https://github.com/slagyr/speclj/blob/master/{filepath}#L{line}"}
}
}
}
}
19 changes: 19 additions & 0 deletions src/speclj/cloverage.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(ns speclj.cloverage
(:require [cloverage.coverage :as coverage]
[speclj.config :refer [*reporters* *runner*]]
[speclj.report.documentation]
[speclj.results :as results]
[speclj.run.standard]
[speclj.running :refer [run-and-report]])
(:import (speclj.report.documentation DocumentationReporter)
(speclj.run.standard StandardRunner)))

(defmethod coverage/runner-fn :speclj [_opts]
(fn [nses]
(let [results (atom [])
runner (StandardRunner. (atom []) results)
reporters [(DocumentationReporter.)]]
(binding [*runner* runner *reporters* reporters]
(apply require (map symbol nses))
(run-and-report runner reporters))
{:errors (results/fail-count @results)})))

0 comments on commit b3d367d

Please sign in to comment.