I'm attempting to measure test coverage for the first time using gcov. Now that I'm past the initial learning curve, things seem to be going well, except for one little snag. I expect that it boils down to a lack of understanding on my part, so I'm hoping someone familiar with gcov can explain what's going on.
The issue is that I have one particular header file showing 0% coverage. However the only thing in that header is a class declaration for a well-used class.
In addition, The implementation file for the class shows 100% coverage, and I can point to 5 different tests where I know for a fact that the class is being successfully instantiated.
So why would gcov report 0% coverage on the class, and how can I fix it?
-- edit --
As lacqui pointed out below, if the header has no executable code, it shouldn't be included in coverage calculations. And in fact, out of all of my classes, that particular header file is the only one that gcov is trying to generate coverage information for.
I've done a line-by-line comparison with the other headers, and the biggest difference I found was that this particular header does not have an explicit constructor or destructor, while the others do. In an attempt to minimize the differences between the files, I added an explicit ctor and dtor to the problem class. However, this did not make any difference.