MantisBT - CMake
View Issue Details
0008932CMakeCTestpublic2009-04-27 12:082016-06-10 14:30
Tom Vercauteren 
Zach Mullen 
normalfeaturealways
closedmoved 
 
 
0008932: Enhance coverage information by globbing for *.gcno instead of *.gcda in ctest
In cdash, it would be interesting to get, in the "Coverage Summary" box, a "Total Coverage" number that is as accurate as possible.

When ctest is used to generate coverage information, it looks for (gc)da files in the build directory rather than (gc)no files - cf. cmCTestCoverageHandler::FindGCovFiles in cmCTestCoverageHandler.cxx.

This might lead to overestimating the coverage percentage.

If I understand it correctly, when everything is setup correctly for a
coverage build:
 - gcc generates (gc)no files at compile time
 - (gc)da files are generated at run time - i.e. when the unit tests are run


This implies that if a given file (say myfile.cpp) is compiled in my project but its code is never
executed when "make test" is called:
1) I want a line to be added in cdash that says that this file is untested
2) In the "Coverage Summary" box of cdash, the number of "Untested
lines" should account for this untested file
3) In my build directory, myfile.cpp.gcno exists
4) In my build directory, myfile.cpp.gcda does not exists

It therefore seems that:
1) A file such as myfile.cpp above would currently not appear at all on cdash.
2) If ctest was to report a file as being "UNTESTED" when a .gcno file
is found without its .gcda counterpart, myfile.cpp would appear on
cdash as being "UNTESTED"

This mailing list thread might provide more information:
http://www.cmake.org/pipermail/cmake/2009-April/029045.html [^]
A patch against today's cvs version of cmake is attached
No tags attached.
patch cmake-cov-gcno-gcda-2009-04-27.patch (1,378) 2009-04-27 12:08
https://public.kitware.com/Bug/file/2190/cmake-cov-gcno-gcda-2009-04-27.patch
Issue History
2009-04-27 12:08Tom VercauterenNew Issue
2009-04-27 12:08Tom VercauterenFile Added: cmake-cov-gcno-gcda-2009-04-27.patch
2009-04-27 12:27Bill HoffmanStatusnew => assigned
2009-04-27 12:27Bill HoffmanAssigned To => Bill Hoffman
2009-04-27 12:35Bill HoffmanNote Added: 0016193
2009-04-27 12:43Tom VercauterenNote Added: 0016194
2009-10-12 15:12David ColeAssigned ToBill Hoffman => David Cole
2010-06-03 08:02Tom VercauterenNote Added: 0020904
2010-06-03 09:02David ColeAssigned ToDavid Cole => Zach Mullen
2010-06-03 09:03David ColeNote Added: 0020905
2010-06-03 09:20Zach MullenNote Added: 0020906
2010-06-03 09:41Tom VercauterenNote Added: 0020907
2016-06-10 14:27Kitware RobotNote Added: 0041547
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0016193)
Bill Hoffman   
2009-04-27 12:35   
Did you test this? Do you have a before and after dashboard link?
(0016194)
Tom Vercauteren   
2009-04-27 12:43   
This patch has been tested with an intranet installation of cdash. There is thus no before and after dashboard link I can share.
(0020904)
Tom Vercauteren   
2010-06-03 08:02   
For the record, this commit seems related to the same problem:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7049dff85a7cbfd64d61de60c27ea794d013570c [^]
(0020905)
David Cole   
2010-06-03 09:03   
Zach, would you say your commit fully addresses this issue... or is there legitimately more of a feature request here than is covered by your recent CTEST_EXTRA_COVERAGE_GLOB code...?
(0020906)
Zach Mullen   
2010-06-03 09:20   
My extra coverage glob feature addresses files in the source directory which are never touched by the compiler.

It was my understanding, given that we see "untested" files all the time, that even files which are not touched at runtime also generate gcda files. This is evidenced by the files listed as 0% coverage in the following list:

http://www.cdash.org/CDash/viewCoverage.php?buildid=624618 [^]

What Tom is requesting is something that *should* already be getting done -- files that do get compiled but which have no lines touched at runtime.

Tom, have you verified that your premises about gcno and gcda are correct?
(0020907)
Tom Vercauteren   
2010-06-03 09:41   
Not sure I fully understand the question. In my project, after a full coverage run by cmake/ctest I get:

> find . -name "*.gcno" | wc -l
767

> find . -name "*.gcda" | wc -l
636

I haven't yet had the time to experiment with a cmake version that has the CTEST_EXTRA_COVERAGE_GLOB code.
(0041547)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.