LCOV
$ lcov Community Low Risklcov collects and merges gcov coverage data into .info tracefiles, filters paths via --remove/--extract, and pairs with genhtml to generate HTML reports. While reliable and scriptable via --summary and --list, it outputs line-oriented text rather than JSON.
brew install lcov Local C/C++ coverage post-processor working directly on compiled build directories.
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
Runs non-interactively and provides deterministic --summary and --list subcommands, but lacks native --json output and emits .info / ASCII tables.
- No JSON output mode; uses
.infotracefiles and text tables - Clean non-interactive exit codes and
--quietflag
Zero network/credential exposure and explicit --output-file targets, though --zerocounters mutates .gcda counter files in build dirs.
- Local filesystem execution only
Available via brew install lcov and Linux distro packages, implemented in Perl; not natively supported on Windows outside WSL/MSYS2.
- Perl-based CLI targeting macOS and Linux
Standard format bridge for C/C++ gcov and multi-suite merging (-a), though newer LLVM projects often prefer llvm-cov JSON.
.infotracefile format is widely consumed by CI coverage tools
Maintained by the Linux Test Project (linux-test-project/lcov) with active v2.x releases.
- Long-running Linux Test Project tool
Traditional man pages and --help output cover flags, though error-suppression rules in v2 can be dense.
- Man page documentation (
lcov.1)
Security, Auth & Guardrails
No credentials required; operates strictly on local .gcno/.gcda and .info coverage files.
GPL-2.0-or-later open-source Linux Test Project tool; free.
# LCOV Agent Rules - Use `lcov --summary <file>` or `lcov --list <file>` for read-only coverage checks. - Pass `--ignore-errors` carefully only for known GCC/Clang version mismatches rather than hiding real errors. - Use `lcov --remove` to strip `/usr/*` system headers before summarizing.
Agent-Ready Command Recipes
Safe Read-Only Queries
lcov --summary coverage.info
Reads coverage.info and prints aggregate line, function, and branch coverage percentages without writing files.
lcov --list coverage.info
Displays tabular per-file coverage metrics from an existing .info tracefile.
Controlled Writes & Previews
lcov --capture --directory build --output-file coverage.info
Collects .gcda/.gcno coverage counters under build/ into coverage.info.
Strengths for Agents
- + Produces portable
.infocoverage tracefiles understood by almost every CI platform. - +
lcov --summaryand--listprovide quick read-only coverage checks.
Caveats & Pitfalls
- ! Lacks native JSON output; agents must parse ASCII summary tables or
.inforecords. - ! Perl dependency and primarily POSIX-focused (macOS/Linux); GCC vs Clang
gcovmismatches often need--gcov-tool.