-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collect coverage for the tests themselves #229
Comments
will probably move that pattern to the config to enable overriding as I feel its not correct to show coverage value to include non library code (having unit test in is bad enough but hard to split out). |
For me, the coverage is less about reaching a specific high percentage; it is about visibility of which lines are covered. Hence https://crates.io/crates/cargo-coverage-annotations which ensures that any lines that are not executed are explicitly marked with a I found this helps in figuring out what's happening in the code; on multiple occasions I was surprised that certain code paths were not taken, even though I expected them to. Yes, I know, pure TDD avoids this, but even then refactoring loses the tight connection between coverage and tests. I would like the same certainty that all my code paths in the test code are actually reached. Admittedly, test code is typically trivial so this doesn't matter as much, but for the rare cases it does matter, it would be nice to have this ability. If nothing else, this would allow me to avoid having to place a So absolutely no argument that the default should be only the |
@orenbenkiki I modified task coverage-kcov and setup the env var there, so it can be overridden on the task level (this is mainly because CARGO_MAKE_WORKING_DIRECTORY can dynamically change per task via cwd attribute). |
Thanks! |
Currently, running
kcov
only generates coverage for files under thesrc/
directory. In my case, I would like to be able to also collect coverage for the files under thetests/
directory.Looking at
Makefile.stable.toml
, the command line is:kcov --include-pattern=${CARGO_MAKE_WORKING_DIRECTORY}/src/ ...
; There doesn't seem to be any environment variable one could set to request that thetests/
directory would also be included in the coverage.How about something like
CARGO_MAKE_KCOV_INCLUDE_TESTS
or perhaps a more generalCARGO_MAKE_KCOV_INCLUDE_PATTERN
?The text was updated successfully, but these errors were encountered: