Painless code coverage reporting for Objective-C
Failed to load latest commit information.
bin Improved error reporting. Feb 27, 2015
lib Bumping version because of accidental gem yank Oct 17, 2015
test Fixed CodeClimate coverage reporting. Mar 1, 2015
.gitignore Added scripts for Travis-CI Feb 13, 2015
Gemfile Trying out code coverage with CodeClimate Mar 1, 2015
LICENSE Initial commit Feb 10, 2015 Fixed typo in readme. Mar 1, 2015
Rakefile Travis build now runs tests Feb 20, 2015
alcove.gemspec Improved error reporting. Feb 27, 2015

Alcove Gem Version Build Status Code Climate Test Coverage

Painless code coverage reporting for Objective-C projects. Most of the heavy lifting is done by the venerable lcov. Alcove simply searches the nooks and crannies to collect the data needed to generate the report and ties everything together for you. Best of all, it's a gem with minimal dependencies, so installation is quick and painless.


$ gem install alcove

You'll also need to install lcov.

With Homebrew:

$ brew install lcov

Or with MacPorts:

$ sudo port install lcov

Xcode Project Configuration

Open your project in Xcode and update your non-test targets to Generate Test Coverage Files and Instrument Program Flow (for Debug configuration only). Xcode

Generating Reports

Now that you have the prerequisites out of the way, you can generate a report. Make sure you've recently executed your tests, then:

alcove --product-name <your-product-name>



Specify this option to change the output directory for the report. Any intermediate paths will be created.


Generates a plaintext file alcove-percent.txt in the output directory, containing only the line coverage percentage.


The product name specified in your Xcode project.


A list of filters to use when gathering files for the report. Use this if you want to exclude certain files from the report. For example: alcove --product-name SampleProduct --remove-filter *.h,main.m will exclude header files and the main.m file from the report.


Use this option to specify the directory to be searched for your product. Alcove plays nicely with the the structure on your development machine, as well as on an Xcode Server, but if you have some funky output directory for your build, you can specify its parent here.


If something doesn't seem quite right, try cleaning the build folder and then run the tests again. Make sure you can generate a report for the demo project, too.


Shoutout to @NateBank for the name suggestion and inspiration.