Group gcov coverage results per folder

  c++, code-coverage, gcov

I’m wondering if there is any way to get gcov coverage results while keeping the source code tree structure, so that we can see coverage results for entire folders ?
I’m currently using lcov to visualize the results, but I don’t mind switching to another tool if is provides that features.

Lcov output (top view)

src/folder1/subfolder1/  12%
src/folder1/subfolder2/  39%
src/folder2/subfolder1/  76%
src/folder2/subfolder2/  100%

What I’m looking for

src/  58%
|-  folder1/ 22%
|     |- subfolder1  12%
|      - subfolder2  39% 
 -  folder2/ 94%
      |- subfolder1  76%
       - subfolder2  100% 

I’m working on a large codebase, and I’d like to have a quick overview of which parts of the code are well covered or not. It would be even better if I could expand the subfolders so that I can see only up to a certain depth 🙂

Source: Windows Questions C++

LEAVE A COMMENT