| Crates.io | workspacer-test-coverage |
| lib.rs | workspacer-test-coverage |
| version | 0.1.2 |
| created_at | 2025-04-01 20:58:47.593271+00 |
| updated_at | 2025-07-13 04:19:50.600056+00 |
| description | Facilitates test execution with code coverage gathering for cargo workspaces using cargo-tarpaulin. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1615543 |
| size | 170,639 |
workspacer-test-coverage is a Rust library designed to facilitate the execution of tests and the collection of code coverage data within a cargo workspace. This crate leverages the cargo-tarpaulin tool to gather comprehensive coverage reports, either in JSON format or from plaintext summaries.
Add workspacer-test-coverage to your Cargo.toml dependencies:
[dependencies]
workspacer-test-coverage = "0.1.0"
Implement the RunTestsWithCoverage trait in your workspace context to run tests and generate coverage reports:
#[async_trait]
impl<P, H: CrateHandleInterface<P>> RunTestsWithCoverage for Workspace<P,H>
where for<'async_trait> P: From<PathBuf> + AsRef<Path> + Send + Sync + 'async_trait {
// Implementation details
}
let workspace = Workspace::new("./my_workspace");
let coverage_report = workspace.run_tests_with_coverage().await?;
println!("Coverage: {:.2}%", coverage_report.total_coverage());
The crate defines TestCoverageError to cover cases such as JSON parse errors, command execution failures, and coverage data anomalies.
workspacer-test-coverage is licensed under the MIT License. See LICENSE for more details.