[CMake] Activating coverage with ctest
ANTON DEGUET
anton.deguet at jhu.edu
Wed Jan 18 22:33:53 EST 2006
Thanks to both you and Xavier,
I had seen this FAQ but I was wandering if there was a way to have this somewhat automated using CMake. I played a bit with my DartConfig.cmake and I now have:
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CTEST_COVERAGE_COMMAND ${COVERAGE_COMMAND})
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs")
LINK_LIBRARIES(gcov)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
This seems to work but I have a few pending questions:
-1- Does this make any sense anyway?
-2- In the FAQ, you don't have a linker option to specify -lgcov. Is this normal?
-3- The tests seem much slower. Before I dig in the gcc documentation, is this to be expected?
-4- This one should probably be in a different thread, but if I try to build a shared library on Mac OS X using the makefile generator I get the following error:
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libgcov.a(_gcov.o) definition of common ___gcov_var (size 4128)
/usr/bin/libtool: internal link edit command failed
Any clue?
Anton
----- Original Message -----
From: Andy Cedilnik <andy.cedilnik at kitware.com>
Date: Wednesday, January 18, 2006 2:56 pm
Subject: Re: [CMake] Activating coverage with ctest
> Hi Anton,
>
> Please check the CTest FAQ:
>
> http://www.cmake.org/Wiki/CTest:FAQ#How_can_I_perform_coverage_test.3F
>
> Andy
>
> ANTON DEGUET wrote:
>
> >Hello,
> >
> >I feel like this is a simple question but I can't figure out the
> answer. When
> >I try to use ctest -DExperimentalCoverage, I get:
> >
> >cisst> ctest -D ExperimentalCoverage
> > Site: Macintosh.local
> > Build name: Darwin-g++-4.0.1--CoVeNuInOs-Py-CNe
> >Performing coverage
> > Cannot find any coverage files.
> >
> >Is there something specific to add in my DartConfig.cmake?
> >
> >What I currently have is:
> ># Options for Dart2
> >SET(DROP_METHOD "xmlrpc")
> >SET(DROP_SITE "http://lacuna.cs.jhu.edu:8081")
> >SET(DROP_LOCATION "cisst")
> >SET(COMPRESS_SUBMISSION ON)
> >
> ># the specified NIGHLY_START_TIME. Time is specified in 24 hour
> format.>SET (NIGHTLY_START_TIME "01:00:00 EDT")
> >
> ># Coverage
> >SET(CTEST_COVERAGE_COMMAND ${COVERAGE_COMMAND})
> >
> >
> >Anton
> >
> >_______________________________________________
> >CMake mailing list
> >CMake at cmake.org
> >http://www.cmake.org/mailman/listinfo/cmake
> >
> >
>
>
> --
> Andy Cedilnik
> Kitware Inc.
>
More information about the CMake
mailing list