Linux Test Project

LCOV - the LTP GCOV extension

About LCOV

LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. LCOV supports statement, function and branch coverage measurement.

Example output

HTML output of a small example project.

Screenshot of an overview page generated by LCOV   Screenshot of a page of source code annotated with coverage information generated by LCOV
Screenshot 1: Overview page Screenshot 2: Annotated source code

Note: source code and Makefile for this example are part of the .tar.gz file (see download section).


Latest release: LCOV 1.13 (changelog).

Source code: LCOV is released under the GPL license.


Instructions on how to quickly get started with lcov:

  1. Ensure that the project is built using GCC
  2. Add --coverage to compiler and linker flags (for example CFLAGS and LDFLAGS)
  3. Compile and run
  4. Collect coverage data:
    lcov --capture --directory project-dir --output-file
  5. Generate HTML output:
    genhtml --output-directory out


Contributing to LCOV

Please see the Contribution guidelines for instructions on how to contribute to LCOV.

Comments And Questions

For comments and questions contact:  Last modified on: December 20, 2016 - 14:27:26 UTC.