Closed protortyp closed 5 months ago
"--engine llvm" in the tarpaulin args may work, but tarpaulin doesn't offer branch coverage as well fwiw, it's just on our roadmap
I'll try to look over the weekend in more detail
Thanks! I tried -engine llvm
but that also fails.
Sorry for the delay, had a brief hiatus while prepping for rustnation!
So this is something that completely slipped my mind but I'm doing some tests now and it looks like it's working (just doing one final tarpaulin run). When there are native dependencies -Clink-dead-code
will fail to compile with Rust (there is an open issue in the compiler for this). So with tarpaulin you should add --no-dead-code
.
This does have the side-effect of making the results less accurate unfortunately. But you can mitigate that with --engine llvm
which does attempt to add in the counters for the dead code in the results still
Okay I've now fully confirmed, it's due to dead code inclusion.
I have started writing a troubleshooting guide which will hopefully provide more comprehensive and quicker help for future similar issues since the readme is a bit dense and some stuff hard to find
I am copying this issue over from the opencv library because I think it is primarily an issue with tarpaulin.
I am using
cargo tarpaulin
to generate code coverage. While everything compiles smoothly in tests and release mode, usingtarpaulin
results in a lot of errors.I have replicated this in a fresh Ubuntu:22.04 docker container. With
rustc --version
: rustc 1.71.1 (eb26296b5 2023-08-03)This is the error output from cargo tarpaulin:
error.log
You can use this Dockerfile to recreate the error with a minimal example that only includes the opencv dependency, and does nothing else besides that.
For now, I am using cargo-llvm-cov, but it does not offer branch coverage and I generally like the html output of tarpaulin much more.
Any hints would be highly appreciated.