(path: str)
| 192 | |
| 193 | |
| 194 | def read_lcov(path: str) -> dict[tuple[str, str], int]: |
| 195 | counts: dict[tuple[str, str], int] = {} |
| 196 | src = None |
| 197 | for line in open(path, encoding="utf-8", errors="replace"): |
| 198 | if line.startswith("SF:"): |
| 199 | src = os.path.relpath(line[3:].strip(), ROOT) |
| 200 | elif line.startswith("FNDA:") and src: |
| 201 | count, name = line[5:].strip().split(",", 1) |
| 202 | key = (src, name) |
| 203 | counts[key] = max(counts.get(key, 0), int(count)) |
| 204 | return counts |
| 205 | |
| 206 | |
| 207 | def cmd_union(args) -> int: |