[CMake] coverage using gcov failed

Lloyd lloydkl.tech at gmail.com
Wed May 1 07:18:16 EDT 2013


On Thu, Apr 25, 2013 at 7:35 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> On 4/25/2013 9:52 AM, Bill Hoffman wrote:
>
>> I see it now.
>>
>> Can you run:
>>
>> ctest -D Experimental -VV
>>
> OK, never mind I know what is wrong...
>
> make ExperimentalCoverage just does the coverage part.
> make Experimental
> make ExpermentalCoverage should work.
>
> Or
>
> cd buildtree
> ctest -T all
>
>
> Available options are:
>   ctest -T all
>   ctest -T start
>   ctest -T update
>   ctest -T configure
>   ctest -T build
>   ctest -T test
>   ctest -T coverage
>   ctest -T memcheck
>   ctest -T notes
>   ctest -T submit



I have been debugging this issue. To make sure that I have a clean
environment I am testing the code on Ubuntu 12.4 32bit.  My system was
installed only with "gcov", lcov was not installed. Now I have installed
"lcov" and also I have modified my main cmake file with the below given
code frahment. Instead of modifying CXX_FLAGS, added the profiling related
compiler arguments using the "ADD_DEFINITIONS". In the first case
(modifying CXX_FLAGS) your suggestion "make Experimental" did not work. Now
(ADD_DEFINITIONS) "make Experimental" works without any problem. Can you
comment on why it was not working earlier?

#Code coverage related code

SET (DO_CODE_COVERAGE false CACHE BOOL "Enable Code coverage?")

if(DO_CODE_COVERAGE)
    ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
    LINK_LIBRARIES(gcov)
endif(DO_CODE_COVERAGE)

Thanks,
  Lloyd



>
>
>
> -Bill
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130501/199dc09b/attachment.htm>


More information about the CMake mailing list