Scripts for test coverage in Rust.
(Tested only on Ubuntu 18.04 & 20.04)
run-all-tests.sh - call all of your tests here
There are 3½ variants of toolsets to pick from:
coverage-grcov.sh*.profraw ---> [grcov] +--------------> HTML | +--> [lcov] ---> HTMLcoverage-llvm.sh*.profraw ---> [llvm-profdata] ---> [llvm-cov] ---> [lcov] ---> HTMLcoverage-gcov.sh*.gcda/*.gcno ---> [gcov] ---> [lcov] ---> HTML
All:
rustup install nightly
Toolset specific:
-
coverage-grcov.shIf needed:
update-alternatives-clang.shto force the defaultllvmversionrustup component add llvm-tools-preview --toolchain nightlycargo install grcovOptionally:
apt-get install lcovWhen in doubt: more about grcov
-
coverage-llvm.shIf needed:
update-alternatives-clang.shto force the defaultllvmversioncargo install rustfiltapt-get install lcovWhen in doubt: this chapter of Rust unstable .
-
coverage-gcov.shapt-get install gcc-7 lcov