-
Notifications
You must be signed in to change notification settings - Fork 149
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
Files without tests missing from final report #617
Comments
I ran across the same issue. It is related to the fact that compilers are way too smart these days and strip all the unused functions from the binary. In a test-scenario this means that all the files that have no used functions under a For more information, have a look at this Rust PR: rust-lang/rust#31368 TL;DR Run your code with the new compiler flag export RUSTFLAGS="-Zinstrument-coverage -Clink-dead-code"
export LLVM_PROFILE_FILE="coverage-pid%p.profraw"
cargo +nightly test --tests
# Run grcov now as usual |
This is a bug of Note that |
rust-lang/rust#86177 has been resolved. |
I noticed that files without any test data are not included in the grcov outputs (specifically the HTML report). This additionally seems to give a wrong coverage percentage, showing a higher percentage than expected as all files without coverage data are not counted in.
Noticed this in my Rust projects so it might be specific to Rust eventually.
Is there any option to tell grcov to take uncovered files into account when generating the report?
Couldn't find anything so far that would help in this regards.
The text was updated successfully, but these errors were encountered: