[CMake] GCOV Coverage Testing. Mac OS X with Clang. Getting gcno files, but no gcna files after execution.

Aaron Smith gngrwzrd.lists at gmail.com
Sun Sep 23 04:33:04 EDT 2012


I'm working on a C project and using CMake. I've been trying to get
coverage testing working and am just about there.

This is what I have figured out so far:

-use clang for c compiler. "gcc" on the latest Xcode does nothing with
-fprofile-arcs and -ftest-coverage
-add -fprofile-arcs and -ftest-coverage to c debug flags
-set cmake build type to debug
-run cmake to build makefile
-double check that gcno files are created for each source file compiled
(they are).

This is where i'm stuck now. I run one of my unit tests and I don't get any
.gcna files created.

The strange thing is that when I use CMake to generate an Xcode project,
and turn on "Generate Test Coverage Files" and "Instrument Program Flow", I
get both gcno and gcna files.

Anyone else experienced this?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120923/e4e75d45/attachment.htm>


More information about the CMake mailing list