safer contract and docs

This commit is contained in:
Spencer Florence 2015-02-14 20:34:43 -05:00
parent 4986abc0ab
commit 6e77ba5b12
2 changed files with 16 additions and 7 deletions

View File

@ -1,6 +1,7 @@
#lang racket/base
(require "cover.rkt" "format.rkt" "private/contracts.rkt" "private/format-utils.rkt"
"private/raw.rkt" racket/contract)
(provide
(contract-out
[coverage/c contract?]
@ -8,8 +9,9 @@
[test-files! (->* () (#:submod symbol?)
#:rest
(listof (or/c path-string?
(list/c path-string? (vectorof string?
#:immutable #t))))
(list/c path-string?
(and/c (lambda (v) (not (impersonator? v)))
(vectorof string? #:immutable #t)))))
any)]
[clear-coverage! (-> any)]
[get-test-coverage (-> coverage/c)]

View File

@ -26,12 +26,19 @@ removed during macro expansion and are thus neither run or not run.
Note that the @racket[srcloc]s are one indexed, meaning a @racket[1]
represents the first character in the file.}
@defproc[(test-files! (#:submod submod symbol? 'test) (files path-string?) ...) any]{
@defproc[(test-files! (#:submod submod symbol? 'test)
(files (or/c path-string?
(list/c path-string
(and/c (negate impersonator?)
(vectorof string? #:immutable #t))))) ...)
any]{
Runs all given @racket[files] and their submodule @racket[submod] (if it exists), storing the coverage information.
The function returns false if any tests fail.
Test coverage information is still collected when test fail.
Test coverage info is added to existing coverage info.}
Runs all given @racket[files] and their submodule @racket[submod] (if it exists), storing the
coverage information. If the path is paired with a vector then that vector is used as the
@racket[current-command-line-arguments] when executing that file. This vector must be immuatable and
not wrapped by a @racket[chaperone] or @racket[impersonator]. The function returns false if any
tests fail. Test coverage information is still collected when test fail. Test coverage info is
added to existing coverage info.}
@defproc[(clear-coverage!) any]{Clears all coverage information.}