I'm using Ubuntu 12, g++ and lcov, the latter installed with apt-get install lcov
.
I'm successfully compiling, and generating html reports with genhtml
. The line coverage information looks good, but many of the function coverage counts seem odd. For example, one C++ class containing just a constructor and virtual destructor is reported by lcov as having 7 functions. Therefore, my coverage is only 2/7 if I call both during the session.
Here is an example output which shows a class with one function that never gets called. I can't work out what that function is:
Can anyone decode the mangled function name, explain the inflated function counts, and suggest how to go about resolving the problem?
Thanks in advance.
Update
OK, since answering my original question below (see comments), I am now inviting suggestions as to how I can prevent these under-the-hood ctors and dtors corrupting my function coverage statistics. How can I limit the function counts to those functions I've written myself?