Test Coverage
Coverage goals, local commands, CI thresholds, and artifact locations for Ferrocat.
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:
85%+line coverage forferrocat-cli, with room to ratchet toward the library threshold as more CLI workflows ship95%+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-cliferrocat-poferrocat-icu
Current Gate
The CI coverage job measures the current percentages on every run, exports the
machine-readable summary, and enforces these crate-level thresholds through
scripts/coverage.sh, the single source for the llvm-cov filters and the
thresholds:
ferrocat-cli >= 85%ferrocat-po >= 95%ferrocat-icu >= 95%ferrocatis still reported, but not percentage-gated untilllvm-covhas measurable lines for the crate
Exact percentages are intentionally read from the current CI artifact instead of being copied into this page. They move whenever covered lines or tests change, while the thresholds above are the stable policy this documentation tracks.
The next high-yield test targets are:
crates/ferrocat-cli/src/main.rsferrocat-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.infoRun the gate exactly as CI runs it:
scripts/coverage.shThat script writes target/lcov.info and target/coverage-summary.json, then
prints the measured percentage per crate against its threshold and exits
non-zero when a gated crate is below it.
CI
The GitHub Actions CI workflow runs a dedicated coverage job on Ubuntu, installs the required LLVM tooling, and runs scripts/coverage.sh — the same command contributors run locally. The thresholds are enforced per crate rather than through one global blended percentage, so a well-covered crate cannot hide a regression in another one.
The job publishes its evidence in three places, on a failing run as much as on a passing one:
- the run's job summary, which lists the measured percentage per crate next to the threshold it was checked against
lcov.infoas a workflow artifactcoverage-summary.json, the machine-readablellvm-covsummary, as a second workflow artifact
Status note (2026-09-07): the gate lives entirely in this repository's CI. The
previous Codecov upload and its CODECOV_TOKEN secret were removed; no
external coverage service is involved, and no coverage token is required to
run or fork the build.