# linux-test-project/lcov architecture

> Architecture diagram of the GitHub repository linux-test-project/lcov, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linux-test-project/lcov
- Repository: https://github.com/linux-test-project/lcov

## Overview

LCOV turns coverage measurements from several tools into LCOV trace data, supports capture and manipulation, and produces browsable HTML or spreadsheet reports. Its principal workflow is measurement capture or format conversion, trace-data processing, then report generation; additional capabilities include differential coverage, description files, and image overviews. The README documents several central tools not present in the supplied tree listing, so those are represented at the documented `bin` directory level. C++ data-structure relationships are limited to those evidenced by the source index or excerpts.

Main entry points: [`bin/genhtml`](https://github.com/linux-test-project/lcov/blob/master/bin/genhtml) (HTML report generation), [`bin/jacoco2lcov`](https://github.com/linux-test-project/lcov/blob/master/bin/jacoco2lcov) (JaCoCo wrapper), [`bin/xml2lcovutil.py`](https://github.com/linux-test-project/lcov/blob/master/bin/xml2lcovutil.py) (XML converter), [`lib/LcovUtil/BranchData.hpp`](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BranchData.hpp) (Branch data API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Capture and conversion"]
  node_capture["Capture and LCOV tools"]
  node_perl_conv["Perl converter"]
  node_llvm_conv["LLVM converter"]
  node_python_conv["Python converter"]
  node_xml_conv["XML converter<br/>[xml2lcovutil.py]"]
  node_jacoco_conv["JaCoCo wrapper"]
end

subgraph group_processing["Trace processing"]
  node_trace_data["LCOV trace data"]
  node_differential["Differential extraction"]
end

subgraph group_reporting["Reports and analysis"]
  node_report["HTML report generation"]
  node_description["Report descriptions"]
  node_png["Source PNG overviews"]
  node_spreadsheet["Spreadsheet reports<br/>[spreadsheet.py]"]
end

subgraph group_internals["Coverage data layer"]
  node_branch["Branch data<br/>[BranchData.cpp]"]
  node_branch_api["Branch data API<br/>[BranchData.hpp]"]
  node_function["Function data<br/>[FunctionData.cpp]"]
  node_function_api["Function data API<br/>[FunctionData.hpp]"]
  node_mcdc["MC/DC data<br/>[MCDCData.cpp]"]
  node_mcdc_api["MC/DC data API<br/>[MCDCData.hpp]"]
  node_count_arith["Count arithmetic<br/>[CountArith.hpp]"]
  node_serializer["Binary serialization"]
end

node_user(("Coverage user"))
node_measurements["Coverage measurements"]

node_user -->|"runs tests"| node_measurements
node_measurements -->|"captures data"| node_capture
node_measurements -->|"converts data"| node_perl_conv
node_measurements -->|"converts data"| node_llvm_conv
node_measurements -->|"converts data"| node_python_conv
node_measurements -->|"converts data"| node_xml_conv
node_measurements -->|"converts data"| node_jacoco_conv
node_capture -->|"creates data"| node_trace_data
node_perl_conv -->|"writes LCOV"| node_trace_data
node_llvm_conv -->|"writes LCOV"| node_trace_data
node_python_conv -->|"writes LCOV"| node_trace_data
node_xml_conv -->|"writes LCOV"| node_trace_data
node_jacoco_conv -->|"invokes converter"| node_xml_conv
node_jacoco_conv -->|"applies LCOV options"| node_trace_data
node_user -->|"manipulates data"| node_trace_data
node_trace_data -->|"generates report"| node_report
node_trace_data -->|"extracts diffs"| node_differential
node_report -.->|"uses descriptions"| node_description
node_report -->|"generates overviews"| node_png
node_trace_data -.->|"feeds reports"| node_spreadsheet
node_user -->|"views coverage"| node_report
node_branch -->|"implements API"| node_branch_api
node_function -->|"implements API"| node_function_api
node_mcdc -->|"implements API"| node_mcdc_api
node_branch_api -->|"uses arithmetic"| node_count_arith
node_function_api -->|"uses arithmetic"| node_count_arith
node_mcdc_api -->|"uses arithmetic"| node_count_arith
node_mcdc -->|"uses branch API"| node_branch_api

click node_capture "https://github.com/linux-test-project/lcov/tree/master/bin"
click node_perl_conv "https://github.com/linux-test-project/lcov/blob/master/bin/perl2lcov"
click node_llvm_conv "https://github.com/linux-test-project/lcov/blob/master/bin/llvm2lcov"
click node_python_conv "https://github.com/linux-test-project/lcov/blob/master/bin/py2lcov"
click node_xml_conv "https://github.com/linux-test-project/lcov/blob/master/bin/xml2lcovutil.py"
click node_jacoco_conv "https://github.com/linux-test-project/lcov/blob/master/bin/jacoco2lcov"
click node_differential "https://github.com/linux-test-project/lcov/blob/master/bin/html2lcov"
click node_report "https://github.com/linux-test-project/lcov/blob/master/bin/genhtml"
click node_description "https://github.com/linux-test-project/lcov/blob/master/bin/gendesc"
click node_png "https://github.com/linux-test-project/lcov/blob/master/bin/genpng"
click node_spreadsheet "https://github.com/linux-test-project/lcov/blob/master/scripts/spreadsheet.py"
click node_branch "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BranchData.cpp"
click node_branch_api "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BranchData.hpp"
click node_function "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/FunctionData.cpp"
click node_function_api "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/FunctionData.hpp"
click node_mcdc "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/MCDCData.cpp"
click node_mcdc_api "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/MCDCData.hpp"
click node_count_arith "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/CountArith.hpp"
click node_serializer "https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BinarySerializer.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_capture,node_perl_conv,node_llvm_conv,node_python_conv,node_xml_conv,node_jacoco_conv,node_user toneBlue
class node_trace_data,node_differential toneAmber
class node_report,node_description,node_png,node_spreadsheet toneMint
class node_branch,node_branch_api,node_function,node_function_api,node_mcdc,node_mcdc_api,node_count_arith,node_serializer toneRose
class node_measurements toneIndigo
```

## Components

### Capture and conversion

- [Capture and LCOV tools](https://github.com/linux-test-project/lcov/tree/master/bin): `bin`
- [Perl converter](https://github.com/linux-test-project/lcov/blob/master/bin/perl2lcov): `bin/perl2lcov`
- [LLVM converter](https://github.com/linux-test-project/lcov/blob/master/bin/llvm2lcov): `bin/llvm2lcov`
- [Python converter](https://github.com/linux-test-project/lcov/blob/master/bin/py2lcov): `bin/py2lcov`
- [XML converter](https://github.com/linux-test-project/lcov/blob/master/bin/xml2lcovutil.py): `bin/xml2lcovutil.py`
- [JaCoCo wrapper](https://github.com/linux-test-project/lcov/blob/master/bin/jacoco2lcov): `bin/jacoco2lcov`

### Trace processing

- **LCOV trace data**
- [Differential extraction](https://github.com/linux-test-project/lcov/blob/master/bin/html2lcov): `bin/html2lcov`

### Reports and analysis

- [HTML report generation](https://github.com/linux-test-project/lcov/blob/master/bin/genhtml): `bin/genhtml`
- [Report descriptions](https://github.com/linux-test-project/lcov/blob/master/bin/gendesc): `bin/gendesc`
- [Source PNG overviews](https://github.com/linux-test-project/lcov/blob/master/bin/genpng): `bin/genpng`
- [Spreadsheet reports](https://github.com/linux-test-project/lcov/blob/master/scripts/spreadsheet.py): `scripts/spreadsheet.py`

### Coverage data layer

- [Branch data](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BranchData.cpp): `lib/LcovUtil/BranchData.cpp`
- [Branch data API](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BranchData.hpp): `lib/LcovUtil/BranchData.hpp`
- [Function data](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/FunctionData.cpp): `lib/LcovUtil/FunctionData.cpp`
- [Function data API](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/FunctionData.hpp): `lib/LcovUtil/FunctionData.hpp`
- [MC/DC data](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/MCDCData.cpp): `lib/LcovUtil/MCDCData.cpp`
- [MC/DC data API](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/MCDCData.hpp): `lib/LcovUtil/MCDCData.hpp`
- [Count arithmetic](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/CountArith.hpp): `lib/LcovUtil/CountArith.hpp`
- [Binary serialization](https://github.com/linux-test-project/lcov/blob/master/lib/LcovUtil/BinarySerializer.hpp): `lib/LcovUtil/BinarySerializer.hpp`

### Other components

- **Coverage user**
- **Coverage measurements**

## Connections

- Coverage user → Coverage measurements: runs tests (evidence: `README.rst`)
- Coverage measurements → Capture and LCOV tools: captures data (evidence: `README.rst`)
- Coverage measurements → Perl converter: converts data (evidence: `README.rst`)
- Coverage measurements → LLVM converter: converts data (evidence: `README.rst`)
- Coverage measurements → Python converter: converts data (evidence: `README.rst`)
- Coverage measurements → XML converter: converts data (evidence: `README.rst`)
- Coverage measurements → JaCoCo wrapper: converts data (evidence: `README.rst`)
- Capture and LCOV tools → LCOV trace data: creates data (evidence: `README.rst`)
- Perl converter → LCOV trace data: writes LCOV (evidence: `README.rst`)
- LLVM converter → LCOV trace data: writes LCOV (evidence: `README.rst`)
- Python converter → LCOV trace data: writes LCOV (evidence: `README.rst`)
- XML converter → LCOV trace data: writes LCOV (evidence: `README.rst`)
- JaCoCo wrapper → XML converter: invokes converter (evidence: `README.rst`)
- JaCoCo wrapper → LCOV trace data: applies LCOV options (evidence: `README.rst`)
- Coverage user → LCOV trace data: manipulates data (evidence: `README.rst`)
- LCOV trace data → HTML report generation: generates report (evidence: `README.rst`)
- LCOV trace data → Differential extraction: extracts diffs (evidence: `README.rst`)
- HTML report generation → Report descriptions: uses descriptions
- HTML report generation → Source PNG overviews: generates overviews (evidence: `README.rst`)
- LCOV trace data → Spreadsheet reports: feeds reports
- Coverage user → HTML report generation: views coverage (evidence: `README.rst`)
- Branch data → Branch data API: implements API (evidence: `lib/LcovUtil/BranchData.cpp`)
- Function data → Function data API: implements API (evidence: `lib/LcovUtil/FunctionData.cpp`)
- MC/DC data → MC/DC data API: implements API (evidence: `lib/LcovUtil/MCDCData.cpp`)
- Branch data API → Count arithmetic: uses arithmetic (evidence: `lib/LcovUtil/BranchData.hpp`)
- Function data API → Count arithmetic: uses arithmetic (evidence: `lib/LcovUtil/FunctionData.hpp`)
- MC/DC data API → Count arithmetic: uses arithmetic (evidence: `lib/LcovUtil/MCDCData.hpp`)
- MC/DC data → Branch data API: uses branch API (evidence: `lib/LcovUtil/MCDCData.cpp`)
