fixing issues #13

This commit is contained in:
Spencer Florence 2015-01-07 11:04:36 -05:00
parent b80d0234e5
commit 054de64fa2
2 changed files with 7 additions and 5 deletions

View File

@ -19,7 +19,6 @@
;; Test files and build coverage map ;; Test files and build coverage map
;; returns true if all tests passed ;; returns true if all tests passed
(define (test-files! . paths) (define (test-files! . paths)
(clear-coverage!)
(for ([path paths]) (for ([path paths])
(define p (define p
(if (absolute-path? path) (if (absolute-path? path)
@ -88,6 +87,9 @@
(namespace-require `(file ,(path->string strace))) (namespace-require `(file ,(path->string strace)))
(namespace-require 'rackunit))) (namespace-require 'rackunit)))
;; A little hack to setup coverage for the first time
(clear-coverage!)
;; -> [Hashof PathString (Listof (List Boolean srcloc))] ;; -> [Hashof PathString (Listof (List Boolean srcloc))]
;; returns a hash of file to a list, where the first of the list is if ;; returns a hash of file to a list, where the first of the list is if
;; that srcloc was covered or not ;; that srcloc was covered or not

View File

@ -11,13 +11,13 @@ functions of test coverage.
@defproc[(test-files! (files path-string?) ...) any/c]{ @defproc[(test-files! (files path-string?) ...) any/c]{
Clears all coverage information, then tests all given @racket[files] Tests all given @racket[files] and stores the coverage information. Returns
and stores the coverage information. Returns false if tests false if tests failed. Test coverage information is still collected when test
failed. Test coverage information is still collected when test fail.} fail. Test coverage info is added to existing coverage info.}
@defproc[(clear-coverage!) any]{Clears all coverage information.} @defproc[(clear-coverage!) any]{Clears all coverage information.}
@defproc[(get-coverage-information) coverage/c]{Gets coverage information.} @defproc[(get-coverage-information) coverage/c]{Gets the current coverage information.}
@defproc[(make-covered? (coverage file-coverage/c) (path path-string?)) @defproc[(make-covered? (coverage file-coverage/c) (path path-string?))
(->* (exact-positive-integer?) (->* (exact-positive-integer?)
(#:byte? boolean?) (#:byte? boolean?)