Inherits from NSObject
Conforms to GHTestDelegate
Declared in GHTestRunner.h
GHTestRunner.m

Overview

Runs the tests. Tests are run a separate thread though delegates are called on the main thread by default.

For example,

GHTestRunner *runner = [[GHTestRunner alloc] initWithTest:suite];
runner.delegate = self;
[runner runTests];

Tasks

Other Methods

Other Methods

Class Methods

run

Run the test runner. Usually called from the test main. Reads the TEST environment variable and filters on that; or all tests are run.

+ (int)run

Return Value

0 is success, otherwise the failure count

Declared In

GHTestRunner.h

runnerForAllTests

Create runner for all tests.

+ (GHTestRunner *)runnerForAllTests

Return Value

Runner

Declared In

GHTestRunner.h

runnerForSuite:

Create runner for test suite.

+ (GHTestRunner *)runnerForSuite:(GHTestSuite *)suite

Parameters

suite

Suite

Return Value

Runner

Declared In

GHTestRunner.h

runnerForTestClassName:methodName:

Create runner for class and method.

+ (GHTestRunner *)runnerForTestClassName:(NSString *)testClassName methodName:(NSString *)methodName

Parameters

testClassName

Test class name

methodName

Test method

Return Value

Runner

Declared In

GHTestRunner.h

runnerFromEnv

Get the runner from the environment. If the TEST env is set, then we will only run that test case or test method.

+ (GHTestRunner *)runnerFromEnv

Declared In

GHTestRunner.h

Instance Methods

cancel

Cancel test run.

- (void)cancel

Declared In

GHTestRunner.h

initWithTest:

Create runner for test.

- (id)initWithTest:(id<GHTest>)test

Parameters

test

Test

Declared In

GHTestRunner.h

log:

Write message to console.

- (void)log:(NSString *)message

Parameters

message

Message to log

Declared In

GHTestRunner.h

runInBackground

Run in the background.

- (void)runInBackground

Declared In

GHTestRunner.h

runTests

Start the test runner.

- (int)runTests

Return Value

0 is success, otherwise the failure count

Declared In

GHTestRunner.h

test:didLog:source:

Test logged a message.

- (void)test:(id<GHTest>)test didLog:(NSString *)message source:(id<GHTest>)source

Parameters

test

Test

didLog

Message

source

If tests are nested, than source corresponds to the originator of the delegate call

Declared In

GHTest.h

testDidEnd:source:

Test ended.

- (void)testDidEnd:(id<GHTest>)test source:(id<GHTest>)source

Parameters

test

Test

source

If tests are nested, than source corresponds to the originator of the delegate call

Declared In

GHTest.h

testDidStart:source:

Test started.

- (void)testDidStart:(id<GHTest>)test source:(id<GHTest>)source

Parameters

test

Test

source

If tests are nested, than source corresponds to the originator of the delegate call

Declared In

GHTest.h

testDidUpdate:source:

Test updated.

- (void)testDidUpdate:(id<GHTest>)test source:(id<GHTest>)source

Parameters

test

Test

source

If tests are nested, than source corresponds to the originator of the delegate call

Declared In

GHTest.h