cargo-llvm-cov
$ cargo-llvm-cov Community Low Riskcargo-llvm-cov automates llvm-profdata and llvm-cov instrumentation for Rust crates and workspaces. Agents can stream structured JSON (--json), emit compact summaries (--summary-only), or write --lcov files cleanly with --color never.
brew install cargo-llvm-cov Local Rust LLVM coverage wrapper around cargo test and cargo nextest; invoke directly in Cargo workspaces.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json directly to stdout, --summary-only to cut token bloat, --color never, and --fail-under-lines gates.
--json --summary-onlyemits compact JSON coverage totals--fail-under-linesenforces coverage thresholds via exit code
Runs locally without credentials, isolating instrumented builds in target/llvm-cov-target to avoid invalidating normal cargo caches.
- Dedicated
target/llvm-cov-targetdirectory
Cross-platform via Homebrew and cargo install, though it requires the llvm-tools-preview rustup component.
- Requires
rustup component add llvm-tools-preview
Eliminates manual RUSTFLAGS + llvm-profdata plumbing and integrates cleanly with cargo nextest (--nextest) and doctests.
- Supports
--nextestand--doctestsin one command
Maintained by prolific Rust tooling author Taiki Endo (taiki-e/cargo-llvm-cov).
- Standard Rust coverage CLI under Apache-2.0 / MIT
Well-organized README and --help covering flags, nextest integration, and CI workflows.
- Complete CLI documentation in repository README
Security, Auth & Guardrails
No credentials required; compiles and profiles local Rust targets via rustc and llvm-tools.
Dual-licensed Apache-2.0 / MIT open-source tool; free.
# cargo-llvm-cov Agent Rules - Prefer `cargo llvm-cov --json --summary-only --color never` to inspect coverage totals without bloated output. - Ensure `rustup component add llvm-tools-preview` is installed before running. - Use `--nextest` when the workspace relies on `cargo-nextest`.
Agent-Ready Command Recipes
Safe Read-Only Queries
cargo llvm-cov --json --summary-only --color never
Runs workspace tests with LLVM instrumentation and outputs compact JSON coverage totals without HTML artifacts.
Controlled Writes & Previews
cargo llvm-cov --lcov --output-path target/lcov.info --color never
Runs tests and writes an LCOV tracefile to target/lcov.info.
Strengths for Agents
- + Native
--json --summary-onlyoutputs concise machine-readable coverage directly to stdout. - + Seamless integration with
cargo nextestvia--nextest. - + Separates instrumented build artifacts into
target/llvm-cov-target.
Caveats & Pitfalls
- ! Requires
llvm-tools-previewrustup component to be installed. - ! Full
--jsonwithout--summary-onlycan emit very large payloads on multi-crate workspaces.