I'm trying to generate some code coverage reports following the guide here: Instrumentation-based Code Coverage - The rustc book
I ran
$ RUSTFLAGS="-C instrument-coverage" cargo test
and got a .profraw file.
I tried to install the required tools by installing
$ cargo install cargo-binutils
However when I try to run
$ llvm-profdata merge -sparse <whatever.profraw -o .profdata
Command 'llvm-profdata' not found, but can be installed with:
sudo apt install llvm
So cargo-binutils doesn't contain all the necessary component.
I'm running on an Ubuntu 20.04 machine and apt wants to install llvm10 but
$ rustc --verbose --version
rustc 1.65.0 (897e37553 2022-11-02
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0
so rustc is using v15.
Can I downgrade rustc to one that uses v10 of llvm or can I install v15 on my Ubuntu machine or is there some other rustup/cargo command that will install the necessary components?
Steve