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).

Download

Latest release: LCOV 1.10 (changelog).

Source code: LCOV is released under the GPL license.

Quickstart

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 coverage.info
  5. Generate HTML output:
    genhtml coverage.info --output-directory out

Documentation

Contributing to LCOV

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

Comments And Questions

For comments and questions contact: ltp-coverage@lists.sourceforge.net


Sourceforge.net  Last modified on: December 09, 2013 - 15:40:45 UTC.
Theme: