Add coverage analysis to CI #2
Description
I tried to add coverage reports to this repository, but it appears that the available tooling isn't that good.
I used kcov and cargo-kcov. To avoid linking errors when running cargo kcov
(presumably caused by the -C link-dead-code
flag when building with cargo kcov
) I had to set the --no-clean-rebuild
flag and build the test binary manually beforehand (cargo test --no-run
). The problems with link-dead-code
are being discussed rust-lang/rust#39293. Unfortunately this leads to optimized/stripped code, so that non-invoked functions don't count to the coverage data.
I won't add kcov to the CI pipeline for now since it produces misleading results. If someone knows how to make it work I'd appreciate any input.
An example of the kcov
output can be found here (sorry, needs JS).
(If someone wants to experiment with kcov directly (without cargo kcov
) I ran into the problem that some of the automatically set breakpoints are invalid, this can be worked around by setting the --verify
flag.)