Alex Rivera | Logout

iOS code coverage broken in Xcode 4.5?

Asked 2012-10-01T08:58:17.037
9

I'm trying to set up code coverage in Xcode 4.5. To do so, I turned on Generate Test Coverage Files and Instrument Program Flow for debug setting. According to http://meandmark.com/blog/2012/08/xcode-4-generating-code-coverage-files-with-llvm/ that's all you need. However, now the linker complains that it can't find:

  • _llvm_gcda_emit_arcs
  • _llvm_gcda_emit_function
  • _llvm_gcda_end_file
  • _llvm_gcda_increment_indirect_counter
  • _llvm_gcda_start_file

I tried to find libprofile_rt.dylib, but it doesn't seem to exist anymore. What else is needed to generate code coverage files?

Edit
Report

1 Answer

4

I also ran into these linker errors. I saw the errors using Xcode 4.2 and 4.3. I'm not sure if they still are there in 4.5.

To solve it I added this file from the llvm project to my unit test code project. To get it to build on my Mac I deleted the win32 and sys includes and replaced the #include "llvm/Support/DataTypes.h" include with #include "stdint.h".

answered 2012-11-06T19:49:16.277

Your Answer