[CMake] Coverage Tests

Bill Hoffman bill.hoffman at kitware.com
Mon Dec 28 10:10:09 EST 2009


Daniel Stonier wrote:
> Had a problem with coverage tests on gentoo today.
> 
> Cmake 2.6.4-r3, g++ 4.3.2-r3, ccache 2.4-r7. 
> 
> It couldn't find the coverage files, even with cflags and link flags 
> enabling "-fprofile-arcs -ftest-coverage". Similar worked on ubuntu no 
> problem.
> 
> A workaround for it I found was to explicitly link in the gcov library, 
> so with link flags it became "-fprofile-arcs -ftest-coverage -lgcov".
> 
> Is this expected/normal?
> 

So, if you build a program on gentoo and do not add -lgcov does it 
produce coverage files when run?  Sounds like a gcc issue.  CMake just 
looks for the coverage files, if they are not there, it will not find 
them....

-Bill


More information about the CMake mailing list