You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And added a simple test case (which checks nothing) using catch2:
#include "test.h"
#include <catch2/catch.hpp>
TEST_CASE("test", "[whatever]")
{
auto testCoverage = new TestCoverage();
testCoverage->testfunc();
}
Afterwards I generated a code coverage report using lcov and generated html file (I have built it with -O0 flag). Html file shows some strange results: https://i.stack.imgur.com/WxSxe.png
The question is: why lines 11 and 12 are displayed as covered? It looks like they are completely mirroring the class member initialization in the header file (a and b initialization). If I move initialization across the header file - the covered lines in the cpp file also move. Is this a bug in lcov or am I missing something?
The text was updated successfully, but these errors were encountered:
The output shows that lines 11 and 12 are already covered in gcov output, so there is little that lcov can do here since it obtains the coverage data from gcov. Therefore I'm closing this issue.
I have created a simple example to illustrate the issue:
test.h
test.cpp
And added a simple test case (which checks nothing) using catch2:
Afterwards I generated a code coverage report using lcov and generated html file (I have built it with -O0 flag). Html file shows some strange results: https://i.stack.imgur.com/WxSxe.png
The question is: why lines 11 and 12 are displayed as covered? It looks like they are completely mirroring the class member initialization in the header file (a and b initialization). If I move initialization across the header file - the covered lines in the cpp file also move. Is this a bug in lcov or am I missing something?
The text was updated successfully, but these errors were encountered: