now disabling test coverage when its not needed

This commit is contained in:
Spencer Florence 2014-12-28 22:24:14 -06:00
parent c639552132
commit bb81fec0d6
3 changed files with 30 additions and 29 deletions

View File

@ -18,7 +18,8 @@
;; PathString * -> Boolean ;; PathString * -> Boolean
;; 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! #:coverage [coverage? #t] . paths)
(parameterize ([test-coverage-enabled coverage?])
(clear-coverage!) (clear-coverage!)
(for ([p paths]) (for ([p paths])
(let loop () (let loop ()
@ -45,7 +46,7 @@
(define submod `(submod (file ,p) test)) (define submod `(submod (file ,p) test))
(when (module-declared? submod) (when (module-declared? submod)
(namespace-require submod)))) (namespace-require submod))))
(not tests-failed))) (not tests-failed))))
(define (make-better-test-compile) (define (make-better-test-compile)
(define compile (current-compile)) (define compile (current-compile))

View File

@ -20,7 +20,7 @@
#:args files #:args files
files))) files)))
(printf "testing ~s\n" files) (printf "testing ~s\n" files)
(define passed (apply test-files! files)) (define passed (keyword-apply test-files! '(#:coverage) (list coverage?) files))
(when coverage? (when coverage?
(printf "COVERAGE!") (printf "COVERAGE!")
(define coverage (get-test-coverage)) (define coverage (get-test-coverage))

View File

@ -1,5 +1,5 @@
#lang racket/base #lang racket/base
(provide annotate-top) (provide annotate-top test-coverage-enabled)
(require errortrace/stacktrace (require errortrace/stacktrace
racket/function racket/function
racket/unit racket/unit