I'm trying to generate some code coverage reports following the guide here: Instrumentation-based Code Coverage - The rustc book
$ 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
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?