Giter VIP home page Giter VIP logo

slather's Introduction

Slather Logo

Gem Version Build Status Coverage Status

Generate test coverage reports for Xcode projects & hook it into CI.

Projects that use Slather

Project Coverage
Parsimmon Parsimmon Coverage
VENCore VENCore Coverage
CGFloatType CGFloatType Coverage
DAZABTest DAZABTest Coverage
TBStateMachine TBStateMachine Coverage

Installation

Add this line to your application's Gemfile:

gem 'slather'

And then execute:

$ bundle

Usage

Set up 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 verify you're ready to generate test coverage, run your test suite on your project, and then run:

$ slather coverage -s path/to/project.xcodeproj

Usage with Coveralls

Login to Coveralls and enable your repository. Right now, slather supports Coveralls via Travis CI and CircleCI.

Make a .slather.yml file:

# .slather.yml

coverage_service: coveralls
xcodeproj: path/to/project.xcodeproj
ignore:
  - ExamplePodCode/*
  - ProjectTestsGroup/*

And then in your .travis.yml or circle.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
# circle.yml

test:
  post:
    - bundle exec slather

Usage with Travis CI Pro

To use Coveralls with Travis CI Pro (for private repos), add following lines along with other settings to .slather.yml:

# .slather.yml

ci_service: travis_pro
coverage_access_token: <YOUR ACCESS TOKEN>

The coverage token can be found at Coveralls repo page. Or it can be passed in via the COVERAGE_ACCESS_TOKEN environment var.

Cobertura

To create a Cobertura XML report set cobertura_xml as coverage service inside your .slather.yml. Optionally you can define an output directory for the XML report:

# .slather.yml

coverage_service: cobertura_xml
xcodeproj: path/to/project.xcodeproj
source_directory: path/to/sources/to/include
output_directory: path/to/xml_report
ignore:
  - ExamplePodCode/*
  - ProjectTestsGroup/*

Or use the command line options --cobertura-xml or -x and --output_directory:

$ slather coverage -x --output-directory path/to/xml_report

Coverage for code included via CocoaPods

If you're trying to compute the coverage of code that has been included via CocoaPods, you will need to tell CocoaPods to use the Slather plugin by adding the following to your Podfile.

plugin 'slather'

You will also need to tell Slather where to find the source files for your Pod.

# .slather.yml

source_directory: Pods/AFNetworking

Custom Build Directory

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

Contributing

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. :octocat:

Please make sure to follow our general coding style and add test coverage for new features!

Contributors

slather's People

Contributors

marklarr avatar ayanonagon avatar kylef avatar neonichu avatar jhersh avatar pietbrauer avatar dlackty avatar viteinfinite avatar diogeneshamilton avatar orta avatar alexgenco avatar chrismaddern avatar dmiedema avatar dasmer avatar pmairoldi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.