Skip to content

Repository files navigation

Cover++

Code coverage engine for C/C++ on Windows.

A modern alternative to the abandoned OpenCppCoverage project.

Go to: Documentation

Screenshot of main view Screenshot of file view

Usage

Report generation

You don't need to compile or link your program with any specific options. Having an .exe and a .pdb is enough.

cover++ run -s path\to\sources my-program.exe

Report visualization

cover++ view report.coverpp

Export

cover++ export json report.coverpp -o report.json

For a complete list of commands and options, see the documentation.

Development

Running tests

Cover++ integrates its various test suites with CTest, allowing them to be conveniently run with one unified command.

mkdir build      # We want an out-of-source build
cd build
cmake ..         # Configure with default options (includes testing)
cmake --build .  # Build
ctest -C Debug   # Run all test suites

Packaging

Cover++ uses CPack to generate installers.

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
cpack

Frontend

To develop the frontend or the documentation, you need Node and pnpm:

winget install OpenJS.NodeJS.LTS
winget install pnpm.pnpm

You can then run development servers in the frontend and docs directories:

pnpm dev

Terminology

A process consists of one or more modules (most commonly one .exe and a few .dlls). Each module needs its own PDB.

A process owns one Virtual Address (VA) space. Each module owns a disjoint, contiguous region of this space.

A module is loaded at a base address. A module itself, and its PDB, contain Relative Virtual Addresses (RVA). These are relative to the base address: VA = base + RVA.

The DIA SDK provides methods using VAs as well as RVAs. Before using any method that deals with VAs, you need to inform the SDK of the base address of the module via IDiaSession::put_loadAddress. We consistently use VAs throughout the codebase; RVAs should not be used.

About

Windows C/C++ code coverage engine

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages