Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/troykomodo/rust-testing-poc
https://github.com/troykomodo/rust-testing-poc
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/troykomodo/rust-testing-poc
- Owner: TroyKomodo
- Created: 2024-12-03T20:12:49.000Z (20 days ago)
- Default Branch: main
- Last Pushed: 2024-12-03T21:02:50.000Z (20 days ago)
- Last Synced: 2024-12-03T21:26:48.635Z (20 days ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Coverage Testing Example
This is an example of how to use the `cargo-llvm-cov` tool to generate coverage reports for a Rust project.
## Setup
```bash
cargo install cargo-binstall
```We need to use nightly Rust to run the tests and generate the coverage report.
```bash
rustup install nightly
```Once you have `binstall` installed, you can install the other tools with the following command:
```bash
cargo binstall -y cargo-nextest cargo-llvm-cov cargo-mutants just cargo-insta
```## Running the tests
```bash
just test
```## Updating the snapshot
```bash
cargo insta review
```## See the coverage report in your browser
```bash
just coverage
```