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