Skip to content

Commit

Permalink
support lcov files without TN
Browse files Browse the repository at this point in the history
Some lcov files don't have a `TN:` field.
The parser currently crashes in this case.
Just set `current_test_name` to empty at the beginning
to handle this case.

The documentation
https://manpages.ubuntu.com/manpages/noble/man1/geninfo.1.html
seems to say that the testname is indeed optional:

```
If available, a tracefile begins with the testname which is stored in the following format:

         TN:<test name>
```
  • Loading branch information
Cheekie25 committed Dec 3, 2024
1 parent 900877e commit 090105a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fastcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ def parseInfo(path):
}

with open(path) as f:
current_test_name = ""
for line in f:
if line.startswith("TN:"):
current_test_name = line[3:].strip()
Expand Down

0 comments on commit 090105a

Please sign in to comment.