2 Racket API
(require cover) | package: cover |
Warning: The API presented here is unstable, and may change without warning.
In addition to being a raco tool, Cover provides racket bindings for running tests and collecting coverage information. The following are the basic functions of test coverage.
2.1 A High Level API
value
=
(-> any/c exact-positive-integer? (or/c 'covered 'uncovered 'irrelevant))
The files key is determined by the first non-#f syntax-source of the program after reading it. Typically this is the string? for of the absolute path of the file path.
The character locations are 1 indexed.
procedure
(test-files! [#:submod submod] files ...) → any
submod : symbol? = 'test
files :
(or/c path-string? (list/c path-string? (vectorof string? #:immutable #t)))
procedure
(get-test-coverage [environment]) → coverage/c
environment : environment? = (current-cover-environment)
'irrelevant —
The location is not considered relevant to coverage information. It is either not in the coverage information; is in a submodule specified by irrelevant-submodules; is a begin-for-syntax form; or lexes (in the sense of that language’s color-lexer) as a comment or whitespace. 'covered —
The location is not 'irrelevant and is covered 'uncovered —
The location is not 'uncovered and is not covered
value
irrelevant-submodules : (parameter/c (or/c #f (listof symbol?)))
procedure
(generate-html-coverage c files [p]) → any
c : coverage/c files : (listof path-string?) p : path-string? = "coverage"
procedure
(environment? v) → any/c
v : any/c
parameter
(current-cover-environment environment) → void? environment : environment?
= (make-cover-environment)
procedure