Re: [CMake] Problems with coverage on OS X Server

2012-03-26 Thread Sean McBride
On Sat, 24 Mar 2012 17:34:22 +, NoRulez said:

>But i?t seems that there is something missing, because I also get the
>message that no coverage files were found for some projects:
>
>-- Coverage Continuous  --
>Cannot find any coverage files. Ignoring Coverage request.
>
>Here are my version informations:
>$ clang --version
>Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)

What version of Xcode is that from?  IIRC, that version of clang is too old to 
support coverage.  Update to Xcode 4.3.2.

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with coverage on OS X Server

2012-03-26 Thread Sean McBride
On Sat, 24 Mar 2012 08:53:04 -0400, David Cole said:

>The answer to that stackoverflow question recommends using
>clang/clang++ instead. (I have not tried this yet myself, but would
>not be entirely surprised to find out it's correct. I have observed
>the zero coverage phenomenon on my own Mac laptop, but have sufficient
>coverage capabilities elsewhere... so I didn't care enough to follow
>up on it previously.)

The state of code coverage with Mac OS tools is not great.  The gcc and 
llvm-gcc that Apple ship don't support coverage.  clang didn't support it for a 
long time, but now does, but there are still a number of bugs, notably this one:



-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with coverage on OS X Server

2012-03-25 Thread P. Martin
Check your SDK version if you are on Lion or Mt. Lion.
On 10.8, Mt. Lion, you should be using XCode-4.4.
For Lion 10.7.3, this is what I have as of March 25, 2012:

$ xcodebuild -version
Xcode 4.3.2
Build version 4E2002

gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) 
(LLVM build 2336.9.00)
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)

If you build llvm from llvm.org head, you will get llvm-cov,
$ /usr/local/bin/llvm-cov --version
LLVM (http://llvm.org/):
  LLVM version 3.1svn
  Optimized build with assertions.
  Built Mar 23 2012 (21:05:05).
  Default target: x86_64-apple-darwin11.3.0
  Host CPU: corei7


To compile dlrdave-SmallAndFast using clang for coverage:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
export CFLAGS='-O0 --coverage'
export CXXFLAGS='-O0 --coverage'
mkdir build
cd build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..
make
./echoargs
gcov -o CMakeFiles/echoargs.dir/echoargs.c.gcda ../echoargs.c
llvm-cov -gcda=CMakeFiles/echoargs.dir/echoargs.c.gcda 
-gcno=CMakeFiles/echoargs.dir/echoargs.c.gcno 


I probably got this all wrong, but there it is.  Some notes:
  It didn't like my -march=native for a cflag with clang.
  I couldn't try compile the simple test with clang HEAD --coverage,
due to missing symbols for x86_64, which is annoying:
error log =>  https://gist.github.com/2198932
  It didn't work with llvm-gcc-4.2.1 (2336.9) even if I added a
 target_link_library(echoargs /usr/lib/libprofile_rt.a)

I guess there's a bug in that version of llvm-gcc, but ttwagos. I'm a n00b.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread NoRulez
But it seems that there is something missing, because I also get the message that no coverage files were found for some projects:-- Coverage Continuous  --Cannot find any coverage files. Ignoring Coverage request.Here are my version informations:$ clang --versionApple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)Target: x86_64-apple-darwin10.8.0Thread model: posix$ gcc --version i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)Copyright (C) 2007 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.$ ctest --versionctest version 2.8.7$ gcov --versiongcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)Copyright (C) 2006 Free Software Foundation, Inc.This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Am 24. März 2012 um 18:12 schrieb David Cole :Yes, the ENV approach is the right way to do it. (that's how I did it, too, although in the calling env and not in the script itself... either is fine)   On Sat, Mar 24, 2012 at 1:10 PM, NoRulez  wrote: > Thanks David, > > I think I found a solution, so if someone is also interessted in this, here > is how i configured clang in a CTestScript.cmake file: > > if (APPLE) >     set (ENV{CC} clang) >     set (ENV{CXX} clang++) > endif (APPLE) > > . > . > . > > ctest_start() > ctest_update() > ctest_configure() > . > . > . > > > Best Regards > NoRulez > > Am 24. März 2012 um 17:42 schrieb "NoRulez" : > > > I've tried to set the C/C++ compiler as followed: >     if (APPLE) >     SET(CMAKE_C_COMPILER "/usr/bin/clang") >     SET(CMAKE_CXX_COMPILER "/usr/bin/clang++") >     endif (APPLE) > > But the result from the build is: >  -- Update Continuous -- >  -- Configure Continuous -- >  -- Reading custom configuration Continuous - Arachne -- >  -- Build Continuous -- >  -- Test Continuous -- > No tests were found!!! >  -- Coverage Continuous -- >  Cannot find any coverage files. Ignoring Coverage request. >  -- Memcheck Continuous -- > No tests were found!!! >  -- Submit Continuous -- > > Best Regards > NoRulez > > Am 24. März 2012 um 17:31 schrieb "NoRulez" : > > I've found this > http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake > > Is this all which I need to configure or did you do something > different/special? > Please could you post your settings to use clang instead of gcc on OS X > > Thanks in advance > > Best Regards > NoRulez > > Am 24. März 2012 um 15:31 schrieb David Cole : > > Well, I've had mixed results trying this myself. > > With the trivial SmallAndFast project, I get a good coverage > measurement on 5 lines of code in 1 source file: > http://my.cdash.org/viewCoverage.php?buildid=313323&status=3 > > With CMake itself, I get a bunch of *.gcda files generated in the > build tree, but the coverage info does not get communicated properly > via a ctest script sending to CDash. Looks like there's some issue > with ctest parsing of the gcov output using ctest 2.8.7 and clang on > the Mac and gcov 4.2.1: > > $ gcov --version > gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) > > Looks like there's a problem somebody will have to fix before it will > work. Unfortunately, the gcov parsing code in ctest is a bit of a > tangle -- last time I was in there, I fixed some stuff up to work in a > MinGW environment, and it's not pretty. Also unfortunately, I don't > think I'll have the bandwidth to look at this myself in the near > future: anybody want to volunteer to take a look and submit a patch to > get this working...? > > > Thx, > David > > > On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote: >> The answer to that stackoverflow question recommends using >> clang/clang++ instead. (I have not tried this yet myself, but would >> not be entirely surprised to find out it's correct. I have observed >> the zero coverage phenomenon on my own Mac laptop, but have sufficient >> coverage capabilities elsewhere... so I didn't care enough to follow >> up on it previously.) >> >> >> HTH, >> David >> >> >> >> On Sat, Mar 24, 2012 at 8:51 AM, David Cole  >> wrote: >>> Perhaps it's because of this problem with the Mac "gcc" which is not >>> *really* just gcc anymore, and apparently doesn't support gcov >>> transparently as it should... >>> >>> >>>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app >>> >>> >>> On Sat, Mar 24, 2012 at 7:45 AM,   wrote:  Hello,   I have the following code in the main CTestScript.cmake which I call  with  "ctest -S CTestScript.cmake, Continuous":       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_

Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread NoRulez
I've found this http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmakeIs this all which I need to configure or did you do something different/special?Please could you post your settings to use clang instead of gcc on OS XThanks in advanceBest RegardsNoRulezAm 24. März 2012 um 15:31 schrieb David Cole :Well, I've had mixed results trying this myself.  With the trivial SmallAndFast project, I get a good coverage measurement on 5 lines of code in 1 source file: http://my.cdash.org/viewCoverage.php?buildid=313323&status=3  With CMake itself, I get a bunch of *.gcda files generated in the build tree, but the coverage info does not get communicated properly via a ctest script sending to CDash. Looks like there's some issue with ctest parsing of the gcov output using ctest 2.8.7 and clang on the Mac and gcov 4.2.1:  $ gcov --version gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)  Looks like there's a problem somebody will have to fix before it will work. Unfortunately, the gcov parsing code in ctest is a bit of a tangle -- last time I was in there, I fixed some stuff up to work in a MinGW environment, and it's not pretty. Also unfortunately, I don't think I'll have the bandwidth to look at this myself in the near future: anybody want to volunteer to take a look and submit a patch to get this working...?   Thx, David   On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote: > The answer to that stackoverflow question recommends using > clang/clang++ instead. (I have not tried this yet myself, but would > not be entirely surprised to find out it's correct. I have observed > the zero coverage phenomenon on my own Mac laptop, but have sufficient > coverage capabilities elsewhere... so I didn't care enough to follow > up on it previously.) > > > HTH, > David > > > > On Sat, Mar 24, 2012 at 8:51 AM, David Cole  wrote: >> Perhaps it's because of this problem with the Mac "gcc" which is not >> *really* just gcc anymore, and apparently doesn't support gcov >> transparently as it should... >> >>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app >> >> >> On Sat, Mar 24, 2012 at 7:45 AM,   wrote: >>> Hello, >>> >>> I have the following code in the main CTestScript.cmake which I call with >>> "ctest -S CTestScript.cmake, Continuous": >>> >>>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W >>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused >>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>> >>>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " >>>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ >>>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ >>>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@ >>>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@ >>>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@ >>>  ") >>> >>> >>>     ## -- Configure >>>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --") >>>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") >>> >>> >>> >>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage >>> information. >>> >>> But on OS X Lion Server I didn't get any coverage informations. >>> >>> On OS X the command gcov is available. >>> >>> >>> Could someone please help? >>> >>> >>> Thanks in advance >>> >>> >>> Best Regards >>> >>> NoRulez >>> >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.cmake.org/mailman/listinfo/cmake--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread David Cole
Yes, the ENV approach is the right way to do it. (that's how I did it,
too, although in the calling env and not in the script itself...
either is fine)


On Sat, Mar 24, 2012 at 1:10 PM, NoRulez  wrote:
> Thanks David,
>
> I think I found a solution, so if someone is also interessted in this, here
> is how i configured clang in a CTestScript.cmake file:
>
> if (APPLE)
>     set (ENV{CC} clang)
>     set (ENV{CXX} clang++)
> endif (APPLE)
>
> .
> .
> .
>
> ctest_start()
> ctest_update()
> ctest_configure()
> .
> .
> .
>
>
> Best Regards
> NoRulez
>
> Am 24. März 2012 um 17:42 schrieb "NoRulez" :
>
>
> I've tried to set the C/C++ compiler as followed:
>     if (APPLE)
>     SET(CMAKE_C_COMPILER "/usr/bin/clang")
>     SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")
>     endif (APPLE)
>
> But the result from the build is:
>  -- Update Continuous --
>  -- Configure Continuous --
>  -- Reading custom configuration Continuous - Arachne --
>  -- Build Continuous --
>  -- Test Continuous --
> No tests were found!!!
>  -- Coverage Continuous --
>  Cannot find any coverage files. Ignoring Coverage request.
>  -- Memcheck Continuous --
> No tests were found!!!
>  -- Submit Continuous --
>
> Best Regards
> NoRulez
>
> Am 24. März 2012 um 17:31 schrieb "NoRulez" :
>
> I've found this
> http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake
>
> Is this all which I need to configure or did you do something
> different/special?
> Please could you post your settings to use clang instead of gcc on OS X
>
> Thanks in advance
>
> Best Regards
> NoRulez
>
> Am 24. März 2012 um 15:31 schrieb David Cole :
>
> Well, I've had mixed results trying this myself.
>
> With the trivial SmallAndFast project, I get a good coverage
> measurement on 5 lines of code in 1 source file:
> http://my.cdash.org/viewCoverage.php?buildid=313323&status=3
>
> With CMake itself, I get a bunch of *.gcda files generated in the
> build tree, but the coverage info does not get communicated properly
> via a ctest script sending to CDash. Looks like there's some issue
> with ctest parsing of the gcov output using ctest 2.8.7 and clang on
> the Mac and gcov 4.2.1:
>
> $ gcov --version
> gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
>
> Looks like there's a problem somebody will have to fix before it will
> work. Unfortunately, the gcov parsing code in ctest is a bit of a
> tangle -- last time I was in there, I fixed some stuff up to work in a
> MinGW environment, and it's not pretty. Also unfortunately, I don't
> think I'll have the bandwidth to look at this myself in the near
> future: anybody want to volunteer to take a look and submit a patch to
> get this working...?
>
>
> Thx,
> David
>
>
> On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote:
>> The answer to that stackoverflow question recommends using
>> clang/clang++ instead. (I have not tried this yet myself, but would
>> not be entirely surprised to find out it's correct. I have observed
>> the zero coverage phenomenon on my own Mac laptop, but have sufficient
>> coverage capabilities elsewhere... so I didn't care enough to follow
>> up on it previously.)
>>
>>
>> HTH,
>> David
>>
>>
>>
>> On Sat, Mar 24, 2012 at 8:51 AM, David Cole 
>> wrote:
>>> Perhaps it's because of this problem with the Mac "gcc" which is not
>>> *really* just gcc anymore, and apparently doesn't support gcov
>>> transparently as it should...
>>>
>>>
>>>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app
>>>
>>>
>>> On Sat, Mar 24, 2012 at 7:45 AM,   wrote:
 Hello,

 I have the following code in the main CTestScript.cmake which I call
 with
 "ctest -S CTestScript.cmake, Continuous":

     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W
 -Wunused-variable -Wunused-parameter -Wunused-function -Wunused
 -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
 -fprofile-arcs -ftest-coverage")
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs
 -ftest-coverage")
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs
 -ftest-coverage")
     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
 -fprofile-arcs -ftest-coverage")
     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
 -fprofile-arcs -ftest-coverage")

     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
  ")


     ## -- Configure
     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")

>>

Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread NoRulez
Thanks David,I think I found a solution, so if someone is also interessted in this, here is how i configured clang in a CTestScript.cmake file:if (APPLE)    set (ENV{CC} clang)    set (ENV{CXX} clang++)endif (APPLE)...ctest_start()ctest_update()ctest_configure()...Best RegardsNoRulezAm 24. März 2012 um 17:42 schrieb "NoRulez" :I've tried to set the C/C++ compiler as followed:    if (APPLE)    SET(CMAKE_C_COMPILER "/usr/bin/clang")    SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")    endif (APPLE)But the result from the build is: -- Update Continuous -- -- Configure Continuous -- -- Reading custom configuration Continuous - Arachne -- -- Build Continuous -- -- Test Continuous --No tests were found!!! -- Coverage Continuous -- Cannot find any coverage files. Ignoring Coverage request. -- Memcheck Continuous --No tests were found!!! -- Submit Continuous --Best RegardsNoRulezAm 24. März 2012 um 17:31 schrieb "NoRulez" :I've found this http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmakeIs this all which I need to configure or did you do something different/special?Please could you post your settings to use clang instead of gcc on OS XThanks in advanceBest RegardsNoRulezAm 24. März 2012 um 15:31 schrieb David Cole :Well, I've had mixed results trying this myself.  With the trivial SmallAndFast project, I get a good coverage measurement on 5 lines of code in 1 source file: http://my.cdash.org/viewCoverage.php?buildid=313323&status=3  With CMake itself, I get a bunch of *.gcda files generated in the build tree, but the coverage info does not get communicated properly via a ctest script sending to CDash. Looks like there's some issue with ctest parsing of the gcov output using ctest 2.8.7 and clang on the Mac and gcov 4.2.1:  $ gcov --version gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)  Looks like there's a problem somebody will have to fix before it will work. Unfortunately, the gcov parsing code in ctest is a bit of a tangle -- last time I was in there, I fixed some stuff up to work in a MinGW environment, and it's not pretty. Also unfortunately, I don't think I'll have the bandwidth to look at this myself in the near future: anybody want to volunteer to take a look and submit a patch to get this working...?   Thx, David   On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote: > The answer to that stackoverflow question recommends using > clang/clang++ instead. (I have not tried this yet myself, but would > not be entirely surprised to find out it's correct. I have observed > the zero coverage phenomenon on my own Mac laptop, but have sufficient > coverage capabilities elsewhere... so I didn't care enough to follow > up on it previously.) > > > HTH, > David > > > > On Sat, Mar 24, 2012 at 8:51 AM, David Cole  wrote: >> Perhaps it's because of this problem with the Mac "gcc" which is not >> *really* just gcc anymore, and apparently doesn't support gcov >> transparently as it should... >> >>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app >> >> >> On Sat, Mar 24, 2012 at 7:45 AM,   wrote: >>> Hello, >>> >>> I have the following code in the main CTestScript.cmake which I call with >>> "ctest -S CTestScript.cmake, Continuous": >>> >>>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W >>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused >>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>> >>>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " >>>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ >>>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ >>>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@ >>>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@ >>>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@ >>>  ") >>> >>> >>>     ## -- Configure >>>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --") >>>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") >>> >>> >>> >>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage >>> information. >>> >>> But on OS X Lion Server I didn't get any coverage informations. >>> >>> On OS X the command gcov is available. >>> >>> >>> Could someone please help? >>> >>> >>> Thanks in advance >>> >>> >>> Best Regards >>> >>> NoRulez >>> >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects a

Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread NoRulez
I've tried to set the C/C++ compiler as followed:    if (APPLE)    SET(CMAKE_C_COMPILER "/usr/bin/clang")    SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")    endif (APPLE)But the result from the build is: -- Update Continuous -- -- Configure Continuous -- -- Reading custom configuration Continuous - Arachne -- -- Build Continuous -- -- Test Continuous --No tests were found!!! -- Coverage Continuous -- Cannot find any coverage files. Ignoring Coverage request. -- Memcheck Continuous --No tests were found!!! -- Submit Continuous --Best RegardsNoRulezAm 24. März 2012 um 17:31 schrieb "NoRulez" :I've found this http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmakeIs this all which I need to configure or did you do something different/special?Please could you post your settings to use clang instead of gcc on OS XThanks in advanceBest RegardsNoRulezAm 24. März 2012 um 15:31 schrieb David Cole :Well, I've had mixed results trying this myself.  With the trivial SmallAndFast project, I get a good coverage measurement on 5 lines of code in 1 source file: http://my.cdash.org/viewCoverage.php?buildid=313323&status=3  With CMake itself, I get a bunch of *.gcda files generated in the build tree, but the coverage info does not get communicated properly via a ctest script sending to CDash. Looks like there's some issue with ctest parsing of the gcov output using ctest 2.8.7 and clang on the Mac and gcov 4.2.1:  $ gcov --version gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)  Looks like there's a problem somebody will have to fix before it will work. Unfortunately, the gcov parsing code in ctest is a bit of a tangle -- last time I was in there, I fixed some stuff up to work in a MinGW environment, and it's not pretty. Also unfortunately, I don't think I'll have the bandwidth to look at this myself in the near future: anybody want to volunteer to take a look and submit a patch to get this working...?   Thx, David   On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote: > The answer to that stackoverflow question recommends using > clang/clang++ instead. (I have not tried this yet myself, but would > not be entirely surprised to find out it's correct. I have observed > the zero coverage phenomenon on my own Mac laptop, but have sufficient > coverage capabilities elsewhere... so I didn't care enough to follow > up on it previously.) > > > HTH, > David > > > > On Sat, Mar 24, 2012 at 8:51 AM, David Cole  wrote: >> Perhaps it's because of this problem with the Mac "gcc" which is not >> *really* just gcc anymore, and apparently doesn't support gcov >> transparently as it should... >> >>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app >> >> >> On Sat, Mar 24, 2012 at 7:45 AM,   wrote: >>> Hello, >>> >>> I have the following code in the main CTestScript.cmake which I call with >>> "ctest -S CTestScript.cmake, Continuous": >>> >>>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W >>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused >>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs >>> -ftest-coverage") >>>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} >>> -fprofile-arcs -ftest-coverage") >>> >>>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " >>>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ >>>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ >>>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@ >>>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@ >>>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@ >>>  ") >>> >>> >>>     ## -- Configure >>>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --") >>>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") >>> >>> >>> >>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage >>> information. >>> >>> But on OS X Lion Server I didn't get any coverage informations. >>> >>> On OS X the command gcov is available. >>> >>> >>> Could someone please help? >>> >>> >>> Thanks in advance >>> >>> >>> Best Regards >>> >>> NoRulez >>> >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.cmake.org/mailman/listinfo/cmake--

Powered by www.kitware.com

Visit other Kitware open-source proje

Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread David Cole
Well, I've had mixed results trying this myself.

With the trivial SmallAndFast project, I get a good coverage
measurement on 5 lines of code in 1 source file:
http://my.cdash.org/viewCoverage.php?buildid=313323&status=3

With CMake itself, I get a bunch of *.gcda files generated in the
build tree, but the coverage info does not get communicated properly
via a ctest script sending to CDash. Looks like there's some issue
with ctest parsing of the gcov output using ctest 2.8.7 and clang on
the Mac and gcov 4.2.1:

$ gcov --version
gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

Looks like there's a problem somebody will have to fix before it will
work. Unfortunately, the gcov parsing code in ctest is a bit of a
tangle -- last time I was in there, I fixed some stuff up to work in a
MinGW environment, and it's not pretty. Also unfortunately, I don't
think I'll have the bandwidth to look at this myself in the near
future: anybody want to volunteer to take a look and submit a patch to
get this working...?


Thx,
David


On Sat, Mar 24, 2012 at 8:53 AM, David Cole  wrote:
> The answer to that stackoverflow question recommends using
> clang/clang++ instead. (I have not tried this yet myself, but would
> not be entirely surprised to find out it's correct. I have observed
> the zero coverage phenomenon on my own Mac laptop, but have sufficient
> coverage capabilities elsewhere... so I didn't care enough to follow
> up on it previously.)
>
>
> HTH,
> David
>
>
>
> On Sat, Mar 24, 2012 at 8:51 AM, David Cole  wrote:
>> Perhaps it's because of this problem with the Mac "gcc" which is not
>> *really* just gcc anymore, and apparently doesn't support gcov
>> transparently as it should...
>>
>>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app
>>
>>
>> On Sat, Mar 24, 2012 at 7:45 AM,   wrote:
>>> Hello,
>>>
>>> I have the following code in the main CTestScript.cmake which I call with
>>> "ctest -S CTestScript.cmake, Continuous":
>>>
>>>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W
>>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused
>>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
>>> -fprofile-arcs -ftest-coverage")
>>>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs
>>> -ftest-coverage")
>>>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs
>>> -ftest-coverage")
>>>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
>>> -fprofile-arcs -ftest-coverage")
>>>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
>>> -fprofile-arcs -ftest-coverage")
>>>
>>>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
>>>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
>>>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
>>>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
>>>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
>>>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
>>>  ")
>>>
>>>
>>>     ## -- Configure
>>>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
>>>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>>>
>>>
>>>
>>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage
>>> information.
>>>
>>> But on OS X Lion Server I didn't get any coverage informations.
>>>
>>> On OS X the command gcov is available.
>>>
>>>
>>> Could someone please help?
>>>
>>>
>>> Thanks in advance
>>>
>>>
>>> Best Regards
>>>
>>> NoRulez
>>>
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> 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
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread David Cole
The answer to that stackoverflow question recommends using
clang/clang++ instead. (I have not tried this yet myself, but would
not be entirely surprised to find out it's correct. I have observed
the zero coverage phenomenon on my own Mac laptop, but have sufficient
coverage capabilities elsewhere... so I didn't care enough to follow
up on it previously.)


HTH,
David



On Sat, Mar 24, 2012 at 8:51 AM, David Cole  wrote:
> Perhaps it's because of this problem with the Mac "gcc" which is not
> *really* just gcc anymore, and apparently doesn't support gcov
> transparently as it should...
>
>  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app
>
>
> On Sat, Mar 24, 2012 at 7:45 AM,   wrote:
>> Hello,
>>
>> I have the following code in the main CTestScript.cmake which I call with
>> "ctest -S CTestScript.cmake, Continuous":
>>
>>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W
>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused
>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
>> -fprofile-arcs -ftest-coverage")
>>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs
>> -ftest-coverage")
>>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs
>> -ftest-coverage")
>>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
>> -fprofile-arcs -ftest-coverage")
>>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
>> -fprofile-arcs -ftest-coverage")
>>
>>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
>>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
>>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
>>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
>>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
>>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
>>  ")
>>
>>
>>     ## -- Configure
>>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
>>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>>
>>
>>
>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage
>> information.
>>
>> But on OS X Lion Server I didn't get any coverage informations.
>>
>> On OS X the command gcov is available.
>>
>>
>> Could someone please help?
>>
>>
>> Thanks in advance
>>
>>
>> Best Regards
>>
>> NoRulez
>>
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> 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
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Problems with coverage on OS X Server

2012-03-24 Thread David Cole
Perhaps it's because of this problem with the Mac "gcc" which is not
*really* just gcc anymore, and apparently doesn't support gcov
transparently as it should...

  
http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app


On Sat, Mar 24, 2012 at 7:45 AM,   wrote:
> Hello,
>
> I have the following code in the main CTestScript.cmake which I call with
> "ctest -S CTestScript.cmake, Continuous":
>
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W
> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused
> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
> -fprofile-arcs -ftest-coverage")
>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs
> -ftest-coverage")
>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs
> -ftest-coverage")
>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
> -fprofile-arcs -ftest-coverage")
>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
> -fprofile-arcs -ftest-coverage")
>
>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
>  CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
>  CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
>  CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
>  CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
>  CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
>  ")
>
>
>     ## -- Configure
>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>
>
>
> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage
> information.
>
> But on OS X Lion Server I didn't get any coverage informations.
>
> On OS X the command gcov is available.
>
>
> Could someone please help?
>
>
> Thanks in advance
>
>
> Best Regards
>
> NoRulez
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Problems with coverage on OS X Server

2012-03-24 Thread norulez
Hello,

I have the following code in the main CTestScript.cmake which I call with 
"ctest -S CTestScript.cmake, Continuous":

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W -Wunused-variable 
-Wunused-parameter -Wunused-function -Wunused -Wno-system-headers 
-Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs 
-ftest-coverage")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs 
-ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs 
-ftest-coverage")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs 
-ftest-coverage")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs 
-ftest-coverage")
FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
 CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
 CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
 CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
 CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
 CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
 ")

## -- Configure
message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")


On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage 
information.
But on OS X Lion Server I didn't get any coverage informations.
On OS X the command gcov is available.

Could someone please help?

Thanks in advance

Best Regards
NoRulez
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake