Kyle Oliveira
Kyle Oliveira

Reputation: 197

Code Coverage On Xcode 4.6.2 and Pure C++ project

I'm trying to get code coverage info from my C++ project using Xcode 4.6.2 but for some reason I can't figure out how to make Apple LLVM output this info. I've tried to use --coverage compile flag (at "OTHER_C++_FLAGS" option) but for some reason the compiler simply doesn't output the .gcov and .gcda files. Any suggestion? Thank you.

Upvotes: 0

Views: 385

Answers (1)

Swift Dev Journal
Swift Dev Journal

Reputation: 20088

To generate the code coverage files, you must set the following build settings to YES: Generate Test Coverage Files and Instrument Program Flow. Your project must also generate debug symbols.

Finding the code coverage files can be difficult since they're buried inside your project's build folder. You can find more detailed information on generating code coverage data with LLVM in the following article:

Xcode 4: Generating Code Coverage Files with LLVM

Upvotes: 1

Related Questions