I have been spending quite a bit of time working with Xcode Server for continuous integration of a fairly large iOS project. As part of the build process, I wanted to generate a test coverage report and place it in on the web server running on our build server. I investigated several existing tools that are capable of generating reports, but found things about each that I disliked. Frankencover is a good solution, but it requires installing the JDK, which is not a normal part of the iOS development stack. XcodeCoverage was another option that I investigated, but it required some executable files that I didn’t want to store in our repository. Dissatisfied with the existing options, I decided that a simple Ruby script could do the job and set out to write my first gem.
Alcove
Alcove is a simple gem that can quickly and reliably generate a code coverage report for an iOS project. Installation is simple, since it’s a gem.
gem install alcove
That’s it. (You’ll also need to install
lcov
, either with Homebrew or MacPorts.)To generate a report, you just need to give alcove your
${PRODUCT_NAME}
and it will do the rest.alcove --product-name YourProductName
After crunching some files, the report will be ready to view in
./alcove-report/
.Check out the README for more information (be sure to check out the options), or the demo project to see it in action.