GHTestGroup Class Reference
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 id
GHTest, 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
-
children
Children for test group.
property -
parent
Parent for test group.
property -
– initWithName:delegate:
Create an empty test group.
-
– initWithTestCase:delegate:
Create test group from a test case.
-
– initWithTestCase:selector:delegate:
Create test group from a single test.
-
+ testGroupFromTestCase:delegate:
Create test group from a test case.
-
– addTestCase:
Add a test case (or test group) to this test group.
-
– addTestGroup:
Add a test group to this test group.
-
– addTests:
Add tests to this group.
-
– addTest:
Add test to this group.
-
– shouldRunOnMainThread
Whether the test group should run on the main thread. Call passes to test case instance if enabled.
-
– hasEnabledChildren
YES if we have any enabled chilren, NO if all children have been disabled.
-
– failedTests
Get list of failed tests.
-
– runInOperationQueue:options:
Run in operation queue. Tests from the group are added and will block until they have completed.
Other Methods
-
– name
Name.
-
– test:didLog:source:
Test logged a message.
-
– testDidStart:source:
Test started.
-
– testDidUpdate:source:
Test updated.
-
– testDidEnd:source:
Test ended.
Properties
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
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
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