[CMake] Coverage Woes

Blezek, Daniel J. Blezek.Daniel at mayo.edu
Mon Dec 22 10:08:08 EST 2008


Hi,

  We're ramping up our testing using CDash, CTest, and CMake.  I started
a coverage build but get no coverage information. I'm not sure how to
debug ctest as it doesn't produce coverage information properly.  Long
post, sorry.

Environment:
$ ctest -version
ctest version 2.7-20080417
$ cmake -version
cmake version 2.7-20080417
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)
$ gcov -v
gcov (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
$ uname -a
Linux mi3bld04.mayo.edu 2.6.18-92.1.10.el5 #1 SMP Tue Aug 5 07:42:41 EDT
2008 x86_64 x86_64 x86_64 GNU/Linux

Our main test driver is called NoOp, I know it's executed, but no
coverage info is produced:

$ find . -name "NoOp*"
./Testing/CoverageInfo/NoOp.cxx.gcda##NoOp.cxx.gcov
./Testing/CoverageInfo/NoOp.cxx.gcda##iostream.gcov
./Testing/CMakeFiles/NoOp.dir
./Testing/CMakeFiles/NoOp.dir/Source/NoOp.cxx.gcda
./Testing/CMakeFiles/NoOp.dir/Source/NoOp.cxx.o
./Testing/CMakeFiles/NoOp.dir/Source/NoOp.cxx.gcno
./bin/NoOp

ctest claims to properly build the output, but doesn't manage to package
it up and ship it out (the file has the proper info in it):

."/usr/bin/gcov" -l -o
"/home/blezek/Source/Testing/MI3CLibNightly-linux86-coverage-gcc/Testing
/CMakeFiles/NoOp.dir/Source"
"/home/blezek/Source/Testing/MI3CLibNightly-linux86-coverage-gcc/Testing
/CMakeFiles/NoOp.dir/Source/NoOp.cxx.gcda"
File
'/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx'
Lines executed:100.00% of 5
/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx:creat
ing 'NoOp.cxx.gcda##NoOp.cxx.gcov'

File
'/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/io
stream'
Lines executed:100.00% of 1
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ios
tream:creating 'NoOp.cxx.gcda##iostream.gcov'

--------------------------------------------------------------
File
'/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx'
Lines executed:100.00% of 5
/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx:creat
ing 'NoOp.cxx.gcda##NoOp.cxx.gcov'

File
'/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/io
stream'
Lines executed:100.00% of 1
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ios
tream:creating 'NoOp.cxx.gcda##iostream.gcov'


--------------------------------------------------------------
   produced s:
/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx
   in file: NoOp.cxx.gcda##NoOp.cxx.gcov
<Snip>
.Process file:
/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx
Actually perfoming coverage for:
/home/blezek/Source/Testing/MI3CLibNightly/Testing/Source/NoOp.cxx


So we have some coverage.  However, ctest does not produce any coverage
information at all, though the file
(./Testing/CoverageInfo/NoOp.cxx.gcda##NoOp.cxx.gcov) has the correct
coverage information in it.




$grep NoOp Testing/20081222-1437/*
Testing/20081222-1437/CoverageLog-2.xml:        <File Name="NoOp.cxx"
FullPath="./Testing/Source/NoOp.cxx">



So it would appear that ctest is not properly generating coverage
information.  Any help, thoughts or suggestions?

Merry Christmas and Happy New Year,
-dan




Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081222/aa3c6cb1/attachment-0001.htm>


More information about the CMake mailing list