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

Sean McBride sean at rogue-research.com
Mon Sep 24 14:25:20 EDT 2012


On Sun, 23 Sep 2012 01:33:04 -0700, Aaron Smith said:

>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

The latest Xcode doesn't even include gcc, that's just a symlink for compatibility.

>-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.

You may be seeing these:
<http://llvm.org/bugs/show_bug.cgi?id=11760>
<http://llvm.org/bugs/show_bug.cgi?id=11457>
<http://llvm.org/bugs/show_bug.cgi?id=11809>

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the CMake mailing list