Rust Coverage
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run a Rust project’s container-free tests under cargo-llvm-cov and report the exact, measured line and region coverage for the files the caller cares about, read from an lcov file and llvm-cov’s JSON summary. It is a read-only measuring skill: it never adds tests, modifies source or test code, changes coverage configuration, or installs tools unless asked to as a follow-up.
Purpose
A coverage number is only meaningful if coverage is actually wired and the right code is measured. iru-rust-coverage checks that cargo-llvm-cov and the llvm-tools component are present, runs the tests once with instrumentation (cargo llvm-cov nextest when cargo-nextest is installed, plain cargo llvm-cov otherwise, always --locked) using --no-report, then writes target/coverage/lcov.info and target/coverage/summary.json and reads both with a small stdlib Python parser. The line % is the gate figure and the region % is reported alongside; branch coverage is reported as unavailable on a stable toolchain, because --branch needs nightly.
Binaries launched by end-to-end tests (for example through assert_cmd) are instrumented too, so a thin src/main.rs is measured fairly. Tooling members such as xtask/ are excluded with --ignore-filename-regex, tests/ files are never reported, and doctests do not count on stable. #[ignore] tests are never run, so the gate value is reproducible without Docker. A run with failing tests still yields a report, labeled as such. The skill never passes --fail-under-* flags: it judges the bar itself. A missing cargo-llvm-cov or llvm-tools-preview, a build failure, or a target absent from the report is reported instead of a false 0%.
Plugin
Shipped by the iru-rust plugin of the ai-catalog marketplace (install with /plugin install iru-rust@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Comma-separated source files ( |
Every reported file in the workspace. |
|
No |
The threshold each target’s line % is judged against. |
|
|
No |
Restricts the run to one workspace member ( |
|
|
No |
|
Default features. |
|
No |
Narrows the test run: a test-name substring, or |
The whole suite. |
Outputs
-
A plain-text summary in the conversation: the runner (
cargo llvm-cov nextestorcargo llvm-cov), the toolchain (stable means no branch data), the selection (--workspaceor-p, features, filter, ignored tests not run), what the exclusion regex removed, and whether the tests passed. -
Total line % and region % (branch reported as unavailable on stable), with a verdict on whether the line % meets the bar.
-
Per target (or per file for a small unscoped run): line % and region %, and for every target under the bar its uncovered line ranges.
-
NOT IN REPORT <target>with the likely cause (module not declared, disabled feature, excluded path, bin-only crate with no executing test) instead of a 0%, and "coverage not wired" with the exact install command when tooling is missing. -
The files
target/coverage/lcov.info,target/coverage/summary.jsonandtarget/coverage/run.logare left in place (target/is gitignored; CI and Sonar read the lcov file). No source, test or configuration is ever modified.
Execution flow
Dependencies
Invokes
None — iru-rust-coverage is a leaf skill. It reuses the runner detection and the container-backed lock procedure (Docker check plus .integration-test.lock) of Rust Test by following the same rules, and borrows that procedure only when integration coverage is explicitly requested.
Invoked by
-
Rust Code One Task Group — the 80% coverage gate, measured from container-free tests alone, via the
iru-gate-runneragent.
Related agents
-
iru-gate-runner— calling skills normally run it inside this sub-agent. It spawns no agents itself.
Source
SKILL.md on GitHub — the file this page was generated from.