Test Coverage
Coverage goals, local commands, CI thresholds, and artifact locations for Ferrocat.
Test Coverage
Ferrocat uses coverage reporting to keep regression work visible, especially in the parser, serializer, catalog API, and ICU parser crates. Coverage is not treated as the only quality signal, but it gives maintainers a concrete guardrail for day-to-day changes.
The repository exposes workspace-local Cargo aliases for coverage reporting through cargo-llvm-cov.
The long-term goal for the shipped library surface is:
95%+line coverage forferrocat-po95%+line coverage forferrocat-icu95%+line coverage forferrocatonce the umbrella crate contains measurable executable logic beyond re-exports
The coverage commands intentionally exclude:
ferrocat-bench, which is a benchmark harness rather than shipped library codeferrocat-conformance, which is fixture data and expectations for the upstream snapshot
That keeps the report focused on the public and internal library crates that matter most in day-to-day development:
ferrocatferrocat-poferrocat-icu
Current Gate
Measured locally on 2026-05-12 with cargo coverage-lcov, a JSON summary export, and the crate-aware gate script:
ferrocat-po:95.08%line coverageferrocat-icu:96.00%line coverageferrocat:N/Ainllvm-covtoday because the umbrella crate is almost entirely re-exports and does not currently surface measurable executable lines in the report
The CI coverage job enforces these crate-level thresholds:
ferrocat-po >= 95%ferrocat-icu >= 95%ferrocatis still reported, but not percentage-gated untilllvm-covhas measurable lines for the crate
The next high-yield test targets are:
ferrocat-po/src/api/catalog.rsferrocat-po/src/api/compile.rsferrocat-po/src/api/audit.rsferrocat-po/src/merge.rsferrocat-po/src/borrowed.rsferrocat-icu/src/parser.rs
Local Setup
Install the required tooling once:
rustup component add llvm-tools-preview
cargo install cargo-llvm-covLocal Commands
Print a terminal summary:
cargo coverage-summaryBuild an HTML report:
cargo coverageThe HTML output is written to:
target/coverage/html/index.htmlGenerate an LCOV file for external tooling:
cargo coverage-lcovThe LCOV output is written to:
target/lcov.infoCI
The GitHub Actions CI workflow runs a dedicated coverage job on Ubuntu, installs the required LLVM tooling, uploads the generated LCOV report to Codecov, and stores the same lcov.info file as a workflow artifact.
That same job now also exports target/coverage-summary.json and runs a small crate-aware gate script so the 95% thresholds are enforced per crate instead of through one global blended percentage.
For private repositories, add a GitHub Actions repository secret named CODECOV_TOKEN.
For public repositories, tokenless upload may also work with codecov/codecov-action@v5 if token authentication has been disabled in the Codecov organization settings. If you want the least surprising setup, keep the CODECOV_TOKEN secret configured either way.