got module running working. tests broken

This commit is contained in:
Spencer Florence 2015-02-16 18:20:10 -05:00
parent 48a967512e
commit b313b99bae
2 changed files with 22 additions and 18 deletions

View File

@ -19,6 +19,7 @@ in "coverage.rkt". This raw coverage information is converted to a usable form b
syntax/modcode
racket/function
syntax/modread
syntax/modresolve
syntax/parse
unstable/syntax
racket/bool
@ -82,11 +83,13 @@ in "coverage.rkt". This raw coverage information is converted to a usable form b
(remove-unneeded-results! abs-names)
(not tests-failed)))
;; ModulePath -> Void
;; ResolvedModulePath -> Void
;; visit and instantiate the given module path in the cover environment
(define (cover-module! to-run [env (current-cover-environment)])
(define (cover-module! p [env (current-cover-environment)])
(define modpath (->absolute p))
(define to-run `(file ,modpath))
(parameterize* ([current-cover-environment env]
[current-load/use-compiled (make-cover-load/use-compiled #f)]
[current-load/use-compiled (make-cover-load/use-compiled (list modpath))]
[current-compile (get-compile)]
[current-namespace (get-namespace)])
(eval (make-dyn-req-expr to-run))))
@ -231,7 +234,8 @@ in "coverage.rkt". This raw coverage information is converted to a usable form b
;; returns a hash of file to a list, where the first of the list is if
;; that srcloc was covered or not
;; based on <pkgs>/drracket/drracket/private/debug.rkt
(define (get-test-coverage)
(define (get-test-coverage [env (current-cover-environment)])
(parameterize ([current-cover-environment env])
(vprintf "generating test coverage\n")
;; filtered : (listof (list boolean srcloc))
@ -246,7 +250,7 @@ in "coverage.rkt". This raw coverage information is converted to a usable form b
file
(lambda (l) (cons v l))
null))
out)
out))
(define current-cover-environment
(make-parameter (make-clean-cover-environment)))

View File

@ -19,7 +19,7 @@
(not-impersonated/c
(vectorof (not-impersonated/c string?) #:immutable #t)))))
any)]
[cover-module! (->* (module-path?) (environment?) any)]
[cover-module! (->* (path-string?) (environment?) any)]
[environment? (-> any/c any/c)]
[environment-namespace (-> environment? namespace?)]
@ -30,7 +30,7 @@
[make-clean-cover-environment (-> environment?)]
[current-cover-environment (parameter/c environment?)]
[get-test-coverage (-> coverage/c)]
[get-test-coverage (->* () (environment?) coverage/c)]
[irrelevant-submodules (parameter/c (or/c #f (listof symbol?)))]
[make-covered?