cover/tests/nested.rkt
Spencer Florence 2ae091805e Fixes #79 #77 and #59
Roughly this commit switches the instrumentation mechanism to use
logging instead of a global hash table. This allows cover to work
across phases, and means that cover no longer needs to lift definitions
at compile time, fixing some submodule bugs.
2015-07-16 18:38:52 -05:00

35 lines
1.0 KiB
Racket

#lang racket
(require rackunit cover racket/runtime-path
"../private/file-utils.rkt")
(define-runtime-path prog "basic/prog.rkt")
(define-runtime-path cov "../cover.rkt")
(define-runtime-path other "simple-multi/2.rkt")
(define (do-test . files)
(define key (->absolute (first files)))
(void
(parameterize ([current-cover-environment (make-cover-environment)])
(check-true (apply test-files! files))
(parameterize ([current-cover-environment (make-cover-environment)])
(parameterize ([current-cover-environment (make-cover-environment)])
(check-true (apply test-files! files))
((get-test-coverage) key 1))
(check-true (apply test-files! files))
((get-test-coverage) key 1))
((get-test-coverage) key 1))))
;; these tests are logically "check-not-exn"s but that obsures inner test failures
(test-case
"Prog nested coverage"
(do-test prog))
(test-case
"Cover nested coverage"
(do-test cov))
(test-case
"Cover nested coverage with many files"
(do-test cov other))