Is there any difference between gcov foo.gcda
, gcov foo.gcno
and gcov foo.cpp
?
According to the official guide, we have to put source file foo.cpp
together with foo.gcda
and foo.gcno
, then use gcov foo.cpp
to generate the report.
But in a CMake Project, object files, gcda
and gcno
files are put in a different folder from the source files, as this Question presents. So sometimes it's hard to find the source files and move them (as I'm calculating coverage for Pytorch Project). Then I tried to skip .cpp
, just do
gcov -i foo.gcda
in the CMake folder in which there are foo.gcda
, foo.gcno
and foo.o
. And the result also shows up. I wonder if this result is also correct, or do I have to copy the corresponding foo.cpp
to this folder and do as official documentation suggests?