From 5ae1e9ae5b3be1da2eb66c7516679699c9f99bec Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Sat, 14 Feb 2015 19:55:46 -0500 Subject: [PATCH] added command line arguments for submodule control --- raco.rkt | 10 +++++++++- scribblings/basics.scrbl | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/raco.rkt b/raco.rkt index 6de525f..eb57b04 100644 --- a/raco.rkt +++ b/raco.rkt @@ -8,6 +8,7 @@ (only-in "private/contracts.rkt" coverage-gen/c) "private/shared.rkt" "private/file-utils.rkt" + "private/format-utils.rkt" (only-in (submod compiler/commands/test paths) collection-paths) pkg/lib) @@ -23,6 +24,7 @@ (define include-exts '()) (define submod 'test) (define expansion-type 'dir) + (define irrel-submods #f) (define args (command-line @@ -50,6 +52,11 @@ [("-s" "--submodule") s "Run the given submodule instead of the test submodule" (set! submod (string->symbol s))] + [("-e" "--irrelevant-submodules") s + "Concider the given submodules irrelevant when generating coverage. If not provided defaults to all submodules." + (unless irrel-submods + (set! irrel-submods null)) + (set! irrel-submods (cons (string->symbol s) irrel-submods))] #:once-any [("-c" "--collection") "Interprets the arguments as collections whose content should be tested (in the same way as directory content)." (set! expansion-type 'collection)] @@ -71,7 +78,8 @@ (define passed (keyword-apply test-files! '(#:submod) (list submod) files)) (define coverage (remove-excluded-paths (get-test-coverage) exclude-paths)) (printf "dumping coverage info into ~s\n" coverage-dir) - (generate-coverage coverage coverage-dir) + (parameterize ([irrelevant-submodules irrel-submods]) + (generate-coverage coverage coverage-dir)) (unless passed (printf "some tests failed\n"))) diff --git a/scribblings/basics.scrbl b/scribblings/basics.scrbl index 5c77675..cff325a 100644 --- a/scribblings/basics.scrbl +++ b/scribblings/basics.scrbl @@ -38,6 +38,9 @@ The @exec{raco cover} command accepts the following flags: --- enable verbose logging} @item{@Flag{s} or @DFlag{submod} --- run the given submodule instead of the test submodule.} + @item{@Flag{e} or @DFlag{include-extensions} + --- Concider the given submodules irrelevant when generating coverage. If not + provided defaults to all submodules. Can be included more than once.} @item{@Flag{c} or @DFlag{collection} --- Interprets the arguments as collections whose content should be tested (in the same way as directory content).}