added verbose flag
This commit is contained in:
parent
24897e0ad0
commit
c036ba9541
|
@ -1,6 +1,6 @@
|
|||
#lang racket
|
||||
(provide generate-coveralls-coverage)
|
||||
(require racket/runtime-path json "format-utils.rkt")
|
||||
(require racket/runtime-path json "format-utils.rkt" "shared.rkt")
|
||||
|
||||
(module+ test
|
||||
(require rackunit "../cover.rkt" racket/runtime-path))
|
||||
|
@ -15,9 +15,14 @@
|
|||
(define coverage-file (build-path coverage-path "coverage.json"))
|
||||
(define json (generate-coveralls-json coverage (hasheq)))
|
||||
(define meta-data (determine-build-type))
|
||||
(define data (for/fold ([blob json]) ([(k v) meta-data]) (hash-set blob k v)))
|
||||
(with-output-to-file coverage-file
|
||||
(thunk (write-json (for/fold ([blob json]) ([(k v) meta-data]) (hash-set blob k v))))
|
||||
(thunk (write-json data))
|
||||
#:exists 'replace)
|
||||
(when (verbose)
|
||||
(printf "\n\n\nwriting json to file ~s\n" dir)
|
||||
(write-json data (current-output-port))
|
||||
(printf "\n\n\n"))
|
||||
(system* (path->string post) coverage-file))
|
||||
|
||||
;; Maps service name to the environment variable that indicates that the service is to be used.
|
||||
|
|
3
private/shared.rkt
Normal file
3
private/shared.rkt
Normal file
|
@ -0,0 +1,3 @@
|
|||
#lang racket/base
|
||||
(provide verbose)
|
||||
(define verbose (make-parameter #f))
|
5
raco.rkt
5
raco.rkt
|
@ -1,5 +1,5 @@
|
|||
#lang racket
|
||||
(require raco/command-name "cover.rkt" "format.rkt")
|
||||
(require raco/command-name "cover.rkt" "format.rkt" "private/shared.rkt")
|
||||
|
||||
(module+ main
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
|||
[("-c" "--coverage") format
|
||||
"Specify that coverage should be run and optional what format. Defaults to html."
|
||||
(set! output-format format)]
|
||||
[("-v" "--verbose")
|
||||
"Verbose mode"
|
||||
(verbose #t)]
|
||||
#:args (file . files)
|
||||
(cons file files))))
|
||||
(define generate-coverage
|
||||
|
|
Loading…
Reference in New Issue
Block a user