Liking cljdoc? Tell your friends :D

com.blockether.vis.lang.clojure.coverage

Test coverage for Clojure: the project's Lazytest run under ClojureStorm and Clofidence.

ClojureStorm is a Clojure compiler that reports each expression it runs, and Clofidence records those reports. A coverage run adds both to the project's own test command through one extra deps.edn alias, :vis-coverage. A Lazytest hook in that alias writes the recorded forms as EDN, because the test JVM has no JSON library. This process then turns them into the vis-coverage/1 JSON report that graphify crap reads:

{"format": "vis-coverage/1", "tool": "clofidence", "prefixes": [...],
 "forms": [{"file": "app/core.clj", "ns": "app.core", "line": 3,
             "kind": "defn", "hittable": 12, "hit": 9,
             "children": {"4": [5, 5]}}]}

file is classpath-relative. hittable counts the expressions the compiler instrumented in the top-level form, and hit the ones that ran. children gives the same counts for each direct element of the form, keyed by its index, so a tool can score each method of a defrecord or an extend-type.

Test coverage for Clojure: the project's Lazytest run under ClojureStorm and
Clofidence.

ClojureStorm is a Clojure compiler that reports each expression it runs, and
Clofidence records those reports. A coverage run adds both to the project's own
test command through one extra deps.edn alias, `:vis-coverage`. A Lazytest hook
in that alias writes the recorded forms as EDN, because the test JVM has no JSON
library. This process then turns them into the `vis-coverage/1` JSON report that
`graphify crap` reads:

    {"format": "vis-coverage/1", "tool": "clofidence", "prefixes": [...],
     "forms": [{"file": "app/core.clj", "ns": "app.core", "line": 3,
                 "kind": "defn", "hittable": 12, "hit": 9,
                 "children": {"4": [5, 5]}}]}

`file` is classpath-relative. `hittable` counts the expressions the compiler
instrumented in the top-level form, and `hit` the ones that ran. `children`
gives the same counts for each direct element of the form, keyed by its index,
so a tool can score each method of a `defrecord` or an `extend-type`.
raw docstring

alias-ednclj

(alias-edn prefixes)

The -Sdeps value that adds the :vis-coverage alias.

The `-Sdeps` value that adds the `:vis-coverage` alias.
sourceraw docstring

clofidence-versionclj

The Clofidence release that records the coverage.

The Clofidence release that records the coverage.
sourceraw docstring

default-prefixesclj

(default-prefixes root)

The namespace prefixes to instrument: for each top-level segment of the project's source namespaces, the prefix that its namespaces share.

The namespace prefixes to instrument: for each top-level segment of the
project's source namespaces, the prefix that its namespaces share.
sourceraw docstring

finish!clj

(finish! root prefixes)

Turn the recorded forms into the report and summarize it. An error names a run that recorded nothing.

Turn the recorded forms into the report and summarize it. An `error` names a
run that recorded nothing.
sourceraw docstring

forms-pathclj

Where the hook writes the recorded forms, under the project root.

Where the hook writes the recorded forms, under the project root.
sourceraw docstring

hook-pathclj

The source path that holds the hook namespace, under the project root.

The source path that holds the hook namespace, under the project root.
sourceraw docstring

hook-varclj

The Lazytest hook that records coverage.

The Lazytest hook that records coverage.
sourceraw docstring

instrument-commandclj

(instrument-command cmd prefixes)

cmd, a clojure ... -M:aliases args... vector, run under the coverage alias with the hook. Nil when cmd has no -M alias argument.

`cmd`, a `clojure ... -M:aliases args...` vector, run under the coverage alias
with the hook. Nil when `cmd` has no `-M` alias argument.
sourceraw docstring

prepare!clj

(prepare! root)

Write the hook namespace and remove the forms of an earlier run.

Write the hook namespace and remove the forms of an earlier run.
sourceraw docstring

reportclj

(report forms prefixes)

The vis-coverage/1 report of the recorded forms that [[measured?]] keeps.

The `vis-coverage/1` report of the recorded `forms` that [[measured?]] keeps.
sourceraw docstring

report-pathclj

The vis-coverage/1 report, under the project root.

The `vis-coverage/1` report, under the project root.
sourceraw docstring

storm-versionclj

The ClojureStorm compiler release, a drop-in replacement for org.clojure/clojure.

The ClojureStorm compiler release, a drop-in replacement for org.clojure/clojure.
sourceraw docstring

summaryclj

(summary root report)

Covered and measured expressions of each file in report.

Covered and measured expressions of each file in `report`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close