catchorg / catchorg/Catch2

Issues with generation of code coverage using lcov/gcov

Open
#686 8 comments 1 reaction 0 assignees View on GitHub
Revisit
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

When using C++ templates, I am seeing an issue where code coverage report fails to show coverage for functions defined as templates. For e.g. if you compile, run and generate the code in attachment using `./generate.sh`, the code coverage for `HelloAnother.inl` shows as zero percentage.

Rerun the same test by changing the Test Case in `main.cpp` to simply use `int main(int argc, char * argv[])` and then rerun `./generate.sh`. You will notice that code coverage now becomes 100%.

[test-profiling.zip](https://github.com/philsquared/Catch/files/378812/test-profiling.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.