option for specifying which files end up in coverage report
timotheecour opened this issue · 2 comments
timotheecour commented
prerequisite: #2
eg usage
# this will run coverage only on specified globs
# !std/this_will_be_ignored/**` could be used to ignore patterns (just like in ripgrep ignore patterns or gitignore)
coverage --cov:modules:'std/**,pkg/regex/bar/*,mylocaldir/src/subdir/foo/**/*.nim,!std/this_will_be_ignored/**'
https://github.com/citycide/glob can be used for parsing globs /cc @citycide
samuelroy commented
There's 2 different things here:
- target directories/files that we need to compile and run in coverage mode
- cleaning up lcov.info by removing unwanted data (like coverage on .nimble pkgs)
We could end up with the following arguments:
- target: glob - defines the folders and files to compile and run in coverage mode
- cov: glob - defines the files that will end up in the coverage report
# !tests/ exclude folder tests from the coverage report
nimcoverage --target:'tests/**/*.' --cov:'./,!tests/'
samuelroy commented
Use the flag --cov
to include and exclude path from the code coverage report. See the latest readme.