/covpare

Simple tool for comparing gcov/llvm-cov output between runs

Primary LanguagePython

covpare-2023

Updated version of covpare and covpare-2020.

Covpare is a simple tool for comparing coverage data generated by gcov or llvm-cov between runs.

Requirements

  • LLVM or GCC build chain
  • MongoDB (used for storage)
  • Python 3

Install

apt install mongodb python python-pip virtualenv
## preferably into the covpare directory
virtualenv venv && source venv/bin/activate
pip install pymongo

Usage

  1. Start a mongodb process, and
  2. use covpare scripts.

Example

The scripts go_llvm.sh and go_gcc.sh show an example for simple files.

  1. Open a terminal in the test directory, and run:
mkdir testdb && mongod --noauth --dbpath testdb
  1. Open a second terminal in that same directory and execute:
source ../venv/bin/activate
./go_llvm.sh
# or
./go_gcc.sh

Assuming you created a python virtual environment venv into the parent directory (for pymongo)


Todo

The redefinition of functions may lost parse.py (the original function wont have the expected function keyword printed by gcov).

  • I added a warning if such cases happen.
    • a better way would be to track redefined functions and rename them accordingly in the database.