Context
From PR #201 code review (CodeRabbit comment on units/Goccia.Coverage.Report.pas:179).
Problem
The lcov and Istanbul JSON exporters only serialize lines with HitCount > 0. Uncovered executable lines are omitted from DA: entries (lcov) and s/statementMap (JSON). This means downstream tools like Codecov and Coveralls will overreport coverage because they only see the lines that were hit, not the full set of executable lines.
The console summary and detail view correctly show uncovered lines (via BuildExecutableLineFlags), but the file exporters don't use this information.
Proposed Fix
Update WriteCoverageLcov and WriteCoverageJSON to:
- Load the source file and call
BuildExecutableLineFlags to determine executable lines
- Emit
DA:line,0 entries for executable lines that have zero hits
- Use the executable line count for
LF: (lines found) instead of only counting hit lines
This requires the exporters to have access to the source files (or the pre-computed executable line flags), which means either passing the source paths through or storing the flags on TGocciaFileCoverage.
Related
Context
From PR #201 code review (CodeRabbit comment on
units/Goccia.Coverage.Report.pas:179).Problem
The lcov and Istanbul JSON exporters only serialize lines with
HitCount > 0. Uncovered executable lines are omitted fromDA:entries (lcov) ands/statementMap(JSON). This means downstream tools like Codecov and Coveralls will overreport coverage because they only see the lines that were hit, not the full set of executable lines.The console summary and detail view correctly show uncovered lines (via
BuildExecutableLineFlags), but the file exporters don't use this information.Proposed Fix
Update
WriteCoverageLcovandWriteCoverageJSONto:BuildExecutableLineFlagsto determine executable linesDA:line,0entries for executable lines that have zero hitsLF:(lines found) instead of only counting hit linesThis requires the exporters to have access to the source files (or the pre-computed executable line flags), which means either passing the source paths through or storing the flags on
TGocciaFileCoverage.Related