Actually, I just discovered an interesting thing. Cmake generally builds things in two steps, first compile the objects, then link. Gcc can do it this way, or do it with a one shot command. I just tried replicating what cmake does manually with gcc on the command line and nope, no .gcno (gcov) file is generated.
However, if I do it on the command line with the oneshot command, as in the gcov tutorial, the .gcno file is generated and everything is fine. i.e. TWO-STEP : fails to build hello.gcno g++ -g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage -o hello.cpp.o -c hello.cpp g++ -fprofile-arcs -ftest-coverage hello.cpp.o -o hello ONE-STEP : builds hello.gcno g++ -g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage -fprofile-arcs -ftest-coverage hello.cpp -o hello At the moment, I can't figure out why...sorry. 2009/4/13 Ian Monroe <[email protected]>: > On Sun, Apr 12, 2009 at 8:51 PM, Daniel Stonier <[email protected]> wrote: >> I'm having a few troubles understanding how to get CTest setup. The >> wiki is a bit piecemeal and just need a pointer in the right >> direction. >> >> Currently, the ctest results are passing for a simple hello world >> project, but I can't get coverage working. > > I'm in pretty much the exact same position. I'm pretty sure I need to > write a CTest script to do coverage testing, but the docs mostly seem > to be innuendo on this subject, so I don't know where to start. > > Ian > _______________________________________________ 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
