-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Missed coverage when function is inlined #1192
Comments
Bump on this as well! Also having this problem. @Nilstrieb did you find a solution? |
no, I was just playing around so I didn't need one |
I have this problem, preventing me from getting my well deserved 95% code coverage (reported ca 81%) 😬 |
I just bumped into this problem too logger::warn!(
"Error while processing message due to {}",
error.to_string()
); The report is somewhat very disturbing because the line error.to_string() is reported as covered but not logger::warn!( but if I inline the code like this: logger::warn!("Error while processing message due to {}", error.to_string()); It works wonderfully. I wonder if any of you have a solution to avoid that? Because the first version is what For information: $ rustc --version
rustc 1.76.0 (07dca489a 2024-02-04)
$ cargo --version
cargo 1.76.0 (c84b36747 2024-01-18)
$ cargo tarpaulin --version
cargo-tarpaulin-tarpaulin 0.28.0 |
When a function is inlined, it's sometimes marked as not executed.
To Reproduce
compiled using
RUSTFLAGS='-Cpasses=inline' cargo tarpaulin
Expected behavior
I expect both lines in the functions to be covered, since they are tested.
I strongly think that this is a cargo-tarpaulin bug as the generated LLVM IR seems to contain the coverage statements correctly and cargo-llvm-cov also shows the entire file as covered.
The text was updated successfully, but these errors were encountered: