gccon it, but I have some difficulties in find the right instructions.
gccthat is install is an alias to
localhost:bin tehnyitchin$ ll gcc*
lrwxr-xr-x 1 root wheel 12 Aug 18 2013 gcc -> llvm-gcc-4.2
So it is not really running the real
gccthat you can get from GNU. Scouring the internet, I came across these instructions at Helsinki University Geodynamic Group.
I am working on this as I want to get code coverage working. It is not working at all with the default
llvm-gcc-4.2. Compiling the code with a
--coveragecauses nothing to occur.
Typically, when the code is compiled with
.gcnofile is also generated.
gcovuses this file as part of its code coverage measurements. If I enable the
-voption to increase its verbosity, I can see that it is linking the
gcovlibrary, but I am not sure if it is actually doing it.
This question on Stack Overflow shows that the code coverage on my OSX is not working.
As I execute a simple
main.c, I am not getting the correct
.gcno. However, when I switch it from
.gcnofiles are generated.
Back to the story, After downloading
xcode-4as per the instruction from Helsinki, it failed to installed due to some unknown reason. The logs did not show anything obvious. I did not continue with installation as
clangwas generating the code coverage files for me. My feeling is that Apple has built
llvm-gcc-4.2without code coverage support. To overcome this, the real
gccis needed. Luckily, in my case, clang came to the rescue.
I am writing a Guide to Successful Unit Tests, you can get it here at Leanpub.