[CMake] Coverage tests with gcov under Linux

Judicaël Bedouet j.bedouet at infonie.fr
Fri May 9 10:58:13 EDT 2008


Hello,

I would like to exploit gcov results with CMake and CDash.

At the moment, I have installed EasyPhp, created a project under CDash
and added CTestConfig.cmake, generated by Cdash, to the source files
of my project.

When I run `make Experimental`, I have errors for each file involved
(see end of my message).

Percentage of executed lines seems good but final percentage coverage
isn't. Under CDash, no files appeared.

I'm working under XUbuntu with g++-4.2, CMake-2.6-0 and CDash-0.8-0.

Under Cygwin, it works better. Files appeared under CDash even if
CMake can't read ten lines. Most of the time, it's the last line of
the source file. Under CDash, files are marked as UNTESTED like in
this page generated today with Linux-g++4.0
http://www.cdash.org/CDash/viewCoverage.php?buildid=71481 but it's an
other problem. Percentage coverage seems good (52.20 %, 641covered
lines).

Does anybody have an idea what the problem is under Linux ?

J. Bedouet

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Performing coverage
   Processing coverage (each . represents one file):
    .Unknown line: [File « /home/xxxxxxxx/cvs/xxxxxxx/Groupe.cpp »]
Unknown line: [Lignes exécutées: 57.14% de 21]
Unknown line: [File « /usr/include/c++/4.2/iostream »]
Unknown line: [Lignes exécutées: 100.00% de 1]
Unknown line: [File « /home/xxxxxxxx/cvs/xxxxxxx/Key.h »]
Unknown line: [Lignes exécutées: 100.00% de 4]

...

Unknown line: [File « /usr/include/c++/4.2/bits/basic_string.h »]
Unknown line: [Lignes exécuteés: 0.00% de 8]
Unknown line: [File « /usr/include/c++/4.2/bits/stl_algobase.h »]
Unknown line: [Lignes executées: 0.00% de 4]

   Acumulating results (each . represents one file):

	Covered LOC:         0
	Not covered LOC:     0
	Total LOC:           0
	Percentage Coverage: 0.00%
Submit files (using http)
   Using HTTP submit method
   Drop site: http://125.xxx.xxx.xxx/CDash/submit.php?project=BDGC
   Uploaded: /home/xxxxxxxx/Testing/20080509-1423/Build.xml
   Uploaded: /home/xxxxxxxx/Testing/20080509-1423/Configure.xml
   Uploaded: /home/xxxxxxxx/Testing/20080509-1423/Coverage.xml
   Uploaded: /home/xxxxxxxx/Testing/20080509-1423/CoverageLog-0.xml
   Uploaded: /home/xxxxxxxx/Testing/20080509-1423/Test.xml
   Submission successful
Errors while running CTest
make[3]: *** [CMakeFiles/Experimental] Erreur 40
make[2]: *** [CMakeFiles/Experimental.dir/all] Erreur 2
make[1]: *** [CMakeFiles/Experimental.dir/rule] Erreur 2
make: *** [Experimental] Erreur 2


More information about the CMake mailing list