Generate test coverage reports for Xcode projects & hook it into CI.
Project | Coverage |
---|---|
Parsimmon | |
VENCore | |
CGFloatType |
Add this line to your application's Gemfile:
gem 'slather'
And then execute:
$ bundle
Setup your project for test coverage:
$ slather setup path/to/project.xcodeproj
This will enable the Generate Test Coverage
and Instrument Program Flow
flags for your project.
To test if you're ready to generate test coverage, run your test suite on your project, and then run:
$ slather coverage -s path/to/project.xcodeproj
Login to https://coveralls.io/ and enable your repository. Right now, slather
only supports coveralls via Travis CI.
Make a .slather.yml
file:
# .slather.yml
coverage_service: coveralls
xcodeproj: path/to/project.xcodeproj
ignore:
- ExamplePodCode/*
- ProjectTestsGroup/*
And then in your .travis.yml
, call slather
after a successful_build
# .travis.yml
before_install: rvm use $RVM_RUBY_VERSION
install: bundle install --without=documentation --path ../travis_bundle_dir
after_success: slather
If you're trying to compute the coverage of code that has been included via CocoaPods, you will need to tell slather where to find the source files for your Pod.
# .slather.yml
source_directory: Pods/AFNetworking
Slather will look for the test coverage files in DerivedData
by default. If you send build output to a custom location, like this, then you should also set the build_directory
property in .slather.yml
We'd love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a new Github issue if you find bugs or have questions.
Please make sure to follow our general coding style and add test coverage for new features!
- @tpoulos, the perfect logo.
- @ayanonagon and @kylef, feedback and testing.