The problem is that there's very minimal (almost no) usage documentation for it. I would like to use it to gather standard Rust lib.rs project test coverage and send it to CodeCov (https://codecov.io/). The only information provided on this topic is:
I even tried the cargo-cov (GitHub - kennytm/cov: LLVM-GCOV Source coverage for Rust), but after installing and running it (with clang being installed on my Ubuntu 18.04), the report was empty. Additionally a test with an attribute #[should_panic] failed even though it works with standard cargo test. I commented it out and run withtout it, but the report was still empty.
grcov uses profiling feature -Z profile, built on the gcov-style support in LLVM and obviously there's still a number of problems with it (not fully baked yet is my assumption based on observation).
I've not tried grcov, but if you're turning on overflow checks, then it seems to me that every overflow check that is not triggered will give you a path that isn't covered.
Hey @dalibor I'm also having problems with some "partially covered" that I quite don't understand. Maybe it will make more sense for you. Could you take a look and see what I'm missing? Or maybe as you mention is just the way that it works for now.
But per example, when trying to access an element in a vector using [index] and also structs that for sure I use in the code. One more per example: to_artists(artists).into_iter().for_each(|artist| {
Here are the links also. I would like to understand how it works because most of my unit tests is covering these things.
I've got the same problems and wasn't able to solve them, thus I'm using the cargo-tarpaulin for now.
Quite probably as mentioned by @jimuazu: "every overflow check that is not triggered will give you a path that isnāt covered", so the question is are you using RUSTFLAGS with Coverflow-checks=off or Coverflow-checks=on?
And as you mentioned it is quite likely that the functionality of -Z profile being used by grcov is not yet fully ready. Here's the tracking issue for that -Z profilehttps://github.com/rust-lang/rust/issues/42524 .
I will have to test it all again some day to see what can be done or if it is fixed already.
I'm using Coverflow-checks=off. I will try this other crate and see how it behaves then. I quite don't get what is -Z profile but I will take a look to understand it. Thanks
grcov currently supports incomplete support and unsupported branch coverage. In addition, there are some problems with incorrect test results. https://github.com/mozilla/grcov/issues/725