Makes a report of your test coverage statistics. In one line.
Houkime a24e54654b adapt to new cargo | 3 maanden geleden | |
---|---|---|
src | 3 maanden geleden | |
.gitignore | 2 jaren geleden | |
Cargo.lock | 2 jaren geleden | |
Cargo.toml | 2 jaren geleden | |
LICENSE | 2 jaren geleden | |
README.md | 2 jaren geleden |
Runs tests and reports crate's test coverage statitics. In one line. A motivational/guidance tool to help writing tests for small-to-medium scale projects, advanced usage support is not planned. Currently only supports Linux (and maybe mac?)
Rustup, nightly toolchain (LLVM tools have weird bugs on stable or when using system's native), and llvm-tools-preview
rustup component. With nightly toolchain chosen, you can add the component with:
rustup component add llvm-tools-preview
Then, add the relevant tool folder to your $PATH
. For me, it was:
export PATH=$HOME/.cargo/bin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:$PATH
Finally, check it is the Rustup's llvm-cov that gets to run with which llvm-cov
. If cool, add the above export line to your .bashrc
.
No distro packages, too early, but you can try it out with Cargo-based install.
cargo install --git https://notabug.org/Houkime/rust-testcov
~/.cargo/bin/
.echo 'export PATH=$HOME/.cargo/bin/:$PATH' >> ~/.bashrc'
and restarting your terminal.In your crate's folder, run:
testcov
Yes, just one line. I wrote testcov because rawer ways to acquire coverage stats are way too elaborate to run often, and I just wanted to keep myself motivated and focused. Down the road, I plan displaying line-by line coverage when run with:
testcov <path to sourcefile>
but that's it API-wise.