From 090105a717d5670df051533af72b764d7ac540ff Mon Sep 17 00:00:00 2001 From: Nicolas Chevrier Date: Tue, 3 Dec 2024 13:03:53 +0100 Subject: [PATCH] support lcov files without TN 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: ``` --- fastcov.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fastcov.py b/fastcov.py index b8202bc..d3b38c0 100755 --- a/fastcov.py +++ b/fastcov.py @@ -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()