<html><body><div>But it seems that there is something missing, because I also get the message that no coverage files were found for some projects:<br><br><span style="font-family: courier new,monospace; font-size: 12px;">-- Coverage Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">Cannot find any coverage files. Ignoring Coverage request.</span><br><br>Here are my version informations:<br><span style="font-family: courier new,monospace; font-size: 12px;">$ clang --version</span><br><span style="font-family: courier new,monospace; font-size: 12px;">Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)</span><br><span style="font-size: 12px; font-family: courier new,monospace;">Target: x86_64-apple-darwin10.8.0</span><br><span style="font-size: 12px; font-family: courier new,monospace;">Thread model: posix</span><br><br><span style="font-family: courier new,monospace; font-size: 12px;">$ gcc --version </span><br><span style="font-family: courier new,monospace; font-size: 12px;">i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)</span><br><span style="font-family: courier new,monospace; font-size: 12px;">Copyright (C) 2007 Free Software Foundation, Inc.</span><br><span style="font-family: courier new,monospace; font-size: 12px;">This is free software; see the source for copying conditions. There is NO</span><br><span style="font-family: courier new,monospace; font-size: 12px;">warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span><br><br></div><div><span style="font-size: 12px; font-family: courier new,monospace;">$ ctest --version</span><br><span style="font-family: courier new,monospace; font-size: 12px;">ctest version 2.8.7</span><br><br><span style="font-family: courier new,monospace; font-size: 12px;">$ gcov --version</span><br><span style="font-family: courier new,monospace; font-size: 12px;">gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)</span><br><span style="font-family: courier new,monospace; font-size: 12px;">Copyright (C) 2006 Free Software Foundation, Inc.</span><br><span style="font-family: courier new,monospace; font-size: 12px;">This is free software; see the source for copying conditions.</span><br><span style="font-family: courier new,monospace; font-size: 12px;">There is NO warranty; not even for MERCHANTABILITY or </span><br><span style="font-family: courier new,monospace; font-size: 12px;">FITNESS FOR A PARTICULAR PURPOSE.</span><br><br>Am 24. März 2012 um 18:12 schrieb David Cole <david.cole@kitware.com>:<br><br><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">Yes, the ENV approach is the right way to do it. (that's how I did it,<br> too, although in the calling env and not in the script itself...<br> either is fine)<br> <br> <br> On Sat, Mar 24, 2012 at 1:10 PM, NoRulez <<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>> wrote:<br> > Thanks David,<br> ><br> > I think I found a solution, so if someone is also interessted in this, here<br> > is how i configured clang in a CTestScript.cmake file:<br> ><br> > if (APPLE)<br> > set (ENV{CC} clang)<br> > set (ENV{CXX} clang++)<br> > endif (APPLE)<br> ><br> > .<br> > .<br> > .<br> ><br> > ctest_start()<br> > ctest_update()<br> > ctest_configure()<br> > .<br> > .<br> > .<br> ><br> ><br> > Best Regards<br> > NoRulez<br> ><br> > Am 24. März 2012 um 17:42 schrieb "NoRulez" <<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>>:<br> ><br> ><br> > I've tried to set the C/C++ compiler as followed:<br> > if (APPLE)<br> > SET(CMAKE_C_COMPILER "/usr/bin/clang")<br> > SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")<br> > endif (APPLE)<br> ><br> > But the result from the build is:<br> > -- Update Continuous --<br> > -- Configure Continuous --<br> > -- Reading custom configuration Continuous - Arachne --<br> > -- Build Continuous --<br> > -- Test Continuous --<br> > No tests were found!!!<br> > -- Coverage Continuous --<br> > Cannot find any coverage files. Ignoring Coverage request.<br> > -- Memcheck Continuous --<br> > No tests were found!!!<br> > -- Submit Continuous --<br> ><br> > Best Regards<br> > NoRulez<br> ><br> > Am 24. März 2012 um 17:31 schrieb "NoRulez" <<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>>:<br> ><br> > I've found this<br> > <a href="http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake" data-mce-href="http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake">http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake</a><br> ><br> > Is this all which I need to configure or did you do something<br> > different/special?<br> > Please could you post your settings to use clang instead of gcc on OS X<br> ><br> > Thanks in advance<br> ><br> > Best Regards<br> > NoRulez<br> ><br> > Am 24. März 2012 um 15:31 schrieb David Cole <<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>>:<br> ><br> > Well, I've had mixed results trying this myself.<br> ><br> > With the trivial SmallAndFast project, I get a good coverage<br> > measurement on 5 lines of code in 1 source file:<br> > <a href="http://my.cdash.org/viewCoverage.php?buildid=313323&status=3" data-mce-href="http://my.cdash.org/viewCoverage.php?buildid=313323&status=3">http://my.cdash.org/viewCoverage.php?buildid=313323&status=3</a><br> ><br> > With CMake itself, I get a bunch of *.gcda files generated in the<br> > build tree, but the coverage info does not get communicated properly<br> > via a ctest script sending to CDash. Looks like there's some issue<br> > with ctest parsing of the gcov output using ctest 2.8.7 and clang on<br> > the Mac and gcov 4.2.1:<br> ><br> > $ gcov --version<br> > gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)<br> ><br> > Looks like there's a problem somebody will have to fix before it will<br> > work. Unfortunately, the gcov parsing code in ctest is a bit of a<br> > tangle -- last time I was in there, I fixed some stuff up to work in a<br> > MinGW environment, and it's not pretty. Also unfortunately, I don't<br> > think I'll have the bandwidth to look at this myself in the near<br> > future: anybody want to volunteer to take a look and submit a patch to<br> > get this working...?<br> ><br> ><br> > Thx,<br> > David<br> ><br> ><br> > On Sat, Mar 24, 2012 at 8:53 AM, David Cole <<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br> >> The answer to that stackoverflow question recommends using<br> >> clang/clang++ instead. (I have not tried this yet myself, but would<br> >> not be entirely surprised to find out it's correct. I have observed<br> >> the zero coverage phenomenon on my own Mac laptop, but have sufficient<br> >> coverage capabilities elsewhere... so I didn't care enough to follow<br> >> up on it previously.)<br> >><br> >><br> >> HTH,<br> >> David<br> >><br> >><br> >><br> >> On Sat, Mar 24, 2012 at 8:51 AM, David Cole <<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br> >> wrote:<br> >>> Perhaps it's because of this problem with the Mac "gcc" which is not<br> >>> *really* just gcc anymore, and apparently doesn't support gcov<br> >>> transparently as it should...<br> >>><br> >>><br> >>> <a href="http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app" data-mce-href="http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app">http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app</a><br> >>><br> >>><br> >>> On Sat, Mar 24, 2012 at 7:45 AM, <<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>> wrote:<br> >>>> Hello,<br> >>>><br> >>>> I have the following code in the main CTestScript.cmake which I call<br> >>>> with<br> >>>> "ctest -S CTestScript.cmake, Continuous":<br> >>>><br> >>>> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W<br> >>>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused<br> >>>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings<br> >>>> -fprofile-arcs -ftest-coverage")<br> >>>> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs<br> >>>> -ftest-coverage")<br> >>>> SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs<br> >>>> -ftest-coverage")<br> >>>> SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}<br> >>>> -fprofile-arcs -ftest-coverage")<br> >>>> SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}<br> >>>> -fprofile-arcs -ftest-coverage")<br> >>>><br> >>>> FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "<br> >>>> CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@<br> >>>> CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@<br> >>>> CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@<br> >>>> CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@<br> >>>> CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@<br> >>>> ")<br> >>>><br> >>>><br> >>>> ## -- Configure<br> >>>> message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")<br> >>>> ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")<br> >>>><br> >>>><br> >>>><br> >>>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get<br> >>>> coverage<br> >>>> information.<br> >>>><br> >>>> But on OS X Lion Server I didn't get any coverage informations.<br> >>>><br> >>>> On OS X the command gcov is available.<br> >>>><br> >>>><br> >>>> Could someone please help?<br> >>>><br> >>>><br> >>>> Thanks in advance<br> >>>><br> >>>><br> >>>> Best Regards<br> >>>><br> >>>> NoRulez<br> >>>><br> >>>><br> >>>> --<br> >>>><br> >>>> Powered by <a href="http://www.kitware.com" data-mce-href="http://www.kitware.com">www.kitware.com</a><br> >>>><br> >>>> Visit other Kitware open-source projects at<br> >>>> <a href="http://www.kitware.com/opensource/opensource.html" data-mce-href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br> >>>><br> >>>> Please keep messages on-topic and check the CMake FAQ at:<br> >>>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" data-mce-href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br> >>>><br> >>>> Follow this link to subscribe/unsubscribe:<br> >>>> <a href="http://www.cmake.org/mailman/listinfo/cmake" data-mce-href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></div></blockquote></div></div></body></html>