I followed Claus’s post to set up code coverage on Xcode 4.2 with LLVM 3.0. I’m able to see test coverage files, but they’re only for my unit test classes, not my actual project classes. I’ve tried setting Generate Test Coverage Files and Instrument Program Flow to Yes on my main target, but that didn’t help, as it failed with the following error:
fopen$UNIX2003 called from function llvm_gcda_start_file
To clarify, I don’t think that’s even the right approach – I just tried it to see if it would generate code coverage on my project classes.
At this point, I’d be happy to try anything that gets code coverage working on my app. Any suggestions?
You are expecting linker problem,
profile_rtlibrary usesfopen$UNIX2003andfwrite$UNIX2003functions instead offopenandfwrite.All you need is to add the following
.cfile to your project:This code just remaps the missing functions to standard ones.
Note on
$UNIX2003suffix:I’ve found an Apple document saying:
So I expect
libprofile_rtto be linked against 10.4 SDK.