Skip to main content

require_executable_lines

Function require_executable_lines 

Source
pub fn require_executable_lines(
    label: &str,
    report: &CoverageReport,
) -> Result<()>
Expand description

Fails when report has no executable lines.

A shard that ran instrumented tests lists every instrumented line, covered or not, so a shard with none means the run failed or its report was lost. Merging it in would not change the result — a union ignores an empty side — so the failure would never surface; this is where it has to.

label names the shard in the message (normally its path). Call this on the freshly parsed report, before path filtering: a shard whose files an --ignore-filename-regex happens to exclude is not broken.