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

Overview

A collection of tests (or test groups).

A test group is a collection of idGHTest, that may represent a set of test case methods.

For example, if you had the following GHTestCase.

 @interface FooTest : GHTestCase {}
 - (void)testFoo;
 - (void)testBar;
 @end

The GHTestGroup would consist of and array of GHTest: FooTest#testFoo, FooTest#testBar, each test being a target and selector pair.

A test group may also consist of a group of groups (since GHTestGroup conforms to GHTest), and this might represent a GHTestSuite.

Tasks

Other Methods

Other Methods

Properties

children

Children for test group.

@property (readonly, strong, nonatomic) NSArray *children

Declared In

GHTestGroup.h

parent

Parent for test group.

@property (unsafe_unretained, nonatomic) id<> parent

Declared In

GHTestGroup.h

Class Methods

testGroupFromTestCase:delegate:

Create test group from a test case.

+ (GHTestGroup *)testGroupFromTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate

Parameters

testCase

Test case, could be a subclass of SenTestCase or GHTestCase

delegate

Delegate, notifies of test start and end

Return Value

New test group

Declared In

GHTestGroup.h

Instance Methods

addTest:

Add test to this group.

- (void)addTest:(id<GHTest>)test

Parameters

test

Test to add

Declared In

GHTestGroup.h

addTestCase:

Add a test case (or test group) to this test group.

- (void)addTestCase:(id)testCase

Parameters

testCase

Test case, could be a subclass of SenTestCase or GHTestCase

Declared In

GHTestGroup.h

addTestGroup:

Add a test group to this test group.

- (void)addTestGroup:(GHTestGroup *)testGroup

Parameters

testGroup

Test group to add

Declared In

GHTestGroup.h

addTests:

Add tests to this group.

- (void)addTests:(NSArray *)tests

Parameters

tests

Tests to add

Declared In

GHTestGroup.h

failedTests

Get list of failed tests.

- (NSArray *)failedTests

Return Value

Failed tests

Declared In

GHTestGroup.h

hasEnabledChildren

YES if we have any enabled chilren, NO if all children have been disabled.

- (BOOL)hasEnabledChildren

Return Value

YES if we have any enabled chilren, NO if all children have been disabled.

Declared In

GHTestGroup.h

initWithName:delegate:

Create an empty test group.

- (id)initWithName:(NSString *)name delegate:(id<GHTestDelegate>)delegate

Parameters

name

The name of the test group

delegate

Delegate, notifies of test start and end

Return Value

New test group

Declared In

GHTestGroup.h

initWithTestCase:delegate:

Create test group from a test case.

- (id)initWithTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate

Parameters

testCase

Test case, could be a subclass of SenTestCase or GHTestCase

delegate

Delegate, notifies of test start and end

Return Value

New test group

Declared In

GHTestGroup.h

initWithTestCase:selector:delegate:

Create test group from a single test.

- (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id<GHTestDelegate>)delegate

Parameters

testCase

Test case, could be a subclass of SenTestCase or GHTestCase

selector

Test to run

delegate

Delegate, notifies of test start and end

Declared In

GHTestGroup.h

name

Name.

- (NSString *)name

Declared In

GHTestGroup.h

runInOperationQueue:options:

Run in operation queue. Tests from the group are added and will block until they have completed.

- (void)runInOperationQueue:(NSOperationQueue *)operationQueue options:(GHTestOptions)options

Parameters

operationQueue

If nil, then runs as is

options

Options

Declared In

GHTestGroup.h

shouldRunOnMainThread

Whether the test group should run on the main thread. Call passes to test case instance if enabled.

- (BOOL)shouldRunOnMainThread

Declared In

GHTestGroup.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