use case
How to read and understand an LCOV .info file
Understand the LCOV .info file format to debug coverage data or write a custom parser.
An LCOV .info file is a plain-text format where each record describes coverage for one source file. Understanding the format helps when debugging why coverage numbers look wrong, when writing a custom parser, or when comparing coverage data between tools. This guide explains every field in the LCOV format and shows how to read a real .info file. The quickhelp.dev LCOV Coverage Viewer can validate that your file is well-formed.
Step-by-step guide
- Understand the record structure: Each file's data starts with SF:<path> and ends with end_of_record. Fields DA:<line>,<hit-count> record each executable line, FN/<FNDA for functions, and BRDA for branches.
- Read the summary fields: LF (lines found) and LH (lines hit) give the file totals. Coverage % = LH/LF × 100. FNF/FNH are function totals; BRF/BRH are branch totals.
- Validate your file: Upload your .info file to quickhelp.dev/lcov-viewer. If the viewer shows no data, check that each record ends with end_of_record and that SF: lines use valid paths.
Frequently asked questions
- What does DA:5,0 mean in an LCOV file?
- DA stands for Data. DA:5,0 means line 5 of the source file was never executed (0 hits). DA:5,3 means line 5 was executed 3 times during the test run.
- What is the TN: field?
- TN (Test Name) is an optional test identifier at the start of a record. Most tools leave it empty (TN:). It has no effect on coverage calculation and is ignored by most viewers.
Try it now
Use the LCOV Coverage Viewer to complete this task — free, no sign-up, runs in your browser.
Open LCOV Coverage Viewer →