[IGSTK-Developers] Code Coverage and "gcov" versions

Luis Ibanez luis.ibanez at kitware.com
Tue Sep 13 10:23:55 EDT 2005


This is a quick note regarding a problem we just
solved in our code coverage submissions and that
it may be useful information for other people.

Zion.kitware was not sending coverage information
despite the fact of having coverage enabled in
CMake.  Looking closely at the problem, we found
the the "gcov" tool was specified generically in
the CMakeCache.txt file.  However, the gcov tool
is specific to the version of the gcc compiler.


That is, with

    gcc-3.3  we must use   gcov-3.3
    gcc-3.4  we must use   gcov-3.4

and so on...



The default gcov, is symbolically linked to the
one corresponding to the default version of the
compiler.  Such version may change as you update
your Linux machine (for example in Debian).



To summarize:

You may want to verify that in your CMake configuration,
or in your ctest script, you have explicit versions for
gcc, g++ and gcov.  The should look like:

   CMAKE_CXX_COMPILER:STRING=/usr/bin/g++-3.3
   CMAKE_C_COMPILER:STRING=/usr/bin/gcc-3.3
   COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov-3.3

or

   CMAKE_CXX_COMPILER:STRING=/usr/bin/g++-3.4
   CMAKE_C_COMPILER:STRING=/usr/bin/gcc-3.4
   COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov-3.4


and never as just

   CMAKE_CXX_COMPILER:STRING=/usr/bin/g++
   CMAKE_C_COMPILER:STRING=/usr/bin/gcc
   COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov




--

    Luis






More information about the IGSTK-Developers mailing list