every.channel: sanitized baseline
This commit is contained in:
commit
897e556bea
258 changed files with 74298 additions and 0 deletions
23
scripts/coverage-summary.sh
Executable file
23
scripts/coverage-summary.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
lcov_path="${1:-}"
|
||||
if [[ -z "${lcov_path}" || ! -f "${lcov_path}" ]]; then
|
||||
echo "usage: $0 <path/to/file.lcov>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# lcov format includes per-file LF (lines found) and LH (lines hit). Sum those.
|
||||
awk '
|
||||
/^LF:/ { lf += substr($0, 4) }
|
||||
/^LH:/ { lh += substr($0, 4) }
|
||||
END {
|
||||
if (lf == 0) {
|
||||
printf("lines: 0/0 (0.00%%)\n")
|
||||
exit 0
|
||||
}
|
||||
pct = (lh * 100.0) / lf
|
||||
printf("lines: %d/%d (%.2f%%)\n", lh, lf, pct)
|
||||
}
|
||||
' "${lcov_path}"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue