(Lesson learned: Always download the developer preview and give it a try, before running Software Update…)
Facebook updated xctool. And I’m happy to say that XcodeCoverage now works with Xcode 5.1! Thanks to my coworker Mike Maietta for figuring out how to create a wrapper around the new gcov so that it continues to work with lcov.
Your coverage numbers may change slightly as you use Xcode 5.1—but not much. And we don’t need the __gcov_flush() workaround anymore. Hurrah!
Bonus: “Generate code coverage report?” prompt
Finally, I incorporated a submission by Matthew Purland which gives you a way to have XcodeCoverage ask whether you want code coverage whenever you run unit tests. If you want to give a try, edit your Xcode scheme and spin down Test to show Post-actions. Add a New Run Script Action, then do the following:
- Set “Shell” to
- Set “Provide build settings from” to your main target (in the example below, I’m doing this for OCHamcrest)
- Set the script to
Once you do that, run your unit tests. Once they complete, you should see this prompt:
Click OK, and XcodeCoverage will run for a while, then show you the coverage results. Pretty slick. (Of course, don’t add this optional step to any shared schemes used in automation.)
…Again, go get the latest XcodeCoverage to get up & running again on Xcode 5.1. Enjoy!