I followed this blog to get the code coverage data on the rust compiler itself, and it worked, but the results were problematic.
In the results, most of the code in the compiler directory is not counted. For example, the coverage rate of rustc_abi is 55/86, but in fact the code in rustc_abi is more than 2k lines.
Is this because these codes are not linked into the binary? Is there any way to include them in the results?
@SparrowLii
How do you specify the binary directory for grcov, i.e., the directory following the -b option? The directory specified with the -b option must include the complete Rust installation directory, not just the rustc binary.
@Surfer I used grcov *.profraw -s /home/liyuan/para-rust/rust/compiler -b /usr/local/bin/ --llvm-path /home/liyuan/para-rust/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin -t html -o cov
This is a screenshot of my results:
Yes, in addition to the bin directory, the lib directory must also be included. I am using the entire installation directory, and based on the lines of code, it appears to be roughly the same.