Giter Site home page Giter Site logo

guard-ocunit's Introduction

Guard::OCUnit Build Status

OCUnit guard allows to automatically launch tests when files are modified.

  • Compatible with XCode 4.x
  • Tested with XCode 4.5.

Install

Please be sure to have Guard and ios-sim installed before continue. guard-ocunit uses ios-sim for running application tests from command line, for more info refer to the SO question.

  • Install the gem:
$ gem install guard-ocunit
  • Add guard definition to your Guardfile by running this command:
$ guard init ocunit
  • Enable Run in the Build section of your test bundle’s scheme.

Usage

Please read Guard usage doc

Guardfile

OCUnit guard can be adapted to your projects.

Standard Cocoapods project

guard :ocunit,
      :derived_data  => '/tmp/tests',
      :workspace     => 'SampleApp.xcworkspace',
      :scheme        => 'SampleApp',
      :test_bundle   => 'SampleAppTests' do

  watch(%r{^SampleAppTests/.+Tests\.m})
  watch(%r{^SampleApp/Models/(.+)\.[m,h]$}) { |m| "SampleAppTests/#{m[1]}Tests.m" }
end

Please read Guard doc for more information about the Guardfile DSL.

Options

By default, Guard::OCUnit will only look for test files within Tests in your project root. You can configure Guard::OCUnit to look in additional paths by using the :test_paths option:

guard 'ocunit', :test_paths => ["Tests", "/Models/Tests"],:test_bundle => 'SampleAppTests' do
  # ...
end

List of available options:

:test_bundle  => '',            # test ocunit bundle with provided name, mandatory parameter
:derived_data => ''/tmp/tests/, # build into provided path, default: current folder
:workspace    => nil,           # build provided workspace, default: nil, use with :scheme
:scheme       => nil,           # build provided scheme, default: nil, use with :workspace
:project      => nil,           # path to the project to test, defaults to current folder
:sdk          => '',            # link and test against provided device sdk, default: 'iphonesimulator'
:verbose      => false          # dump all tests information in console
:notification => false          # display notification after the tests are done running, default: true
:all_after_pass => false        # run all tests after changed tests pass, default: true
:all_on_start => false          # run all tests at startup, default: true
:keep_failed  => false          # keep failed tests until they pass, default: true
:tests_paths  => ["Tests"]      # specify an array of paths that contain test files
:focus_on_failed => false       # focus on the first 10 failed tests first, rerun till they pass
:clean        => false          # defines all builds as clean. By default run all command doing clean build
:build_variables => ''          # passes provided parameters to the xcodebuild
:ios_sim_opts => ''             # passes provided options to the ios-sim

Credits

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.