GHTestRunner Class Reference
| 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
-
– initWithTest:Create runner for test.
-
+ runnerForAllTestsCreate runner for all tests.
-
+ runnerForSuite:Create runner for test suite.
-
+ runnerForTestClassName:methodName:Create runner for class and method.
-
+ runnerFromEnvGet the runner from the environment. If the TEST env is set, then we will only run that test case or test method.
-
+ runRun the test runner. Usually called from the test main. Reads the TEST environment variable and filters on that; or all tests are run.
-
– runInBackgroundRun in the background.
-
– runTestsStart the test runner.
-
– cancelCancel test run.
-
– log:Write message to console.
Other Methods
-
– testDidStart:source:Test started.
-
– testDidUpdate:source:Test updated.
-
– testDidEnd:source:Test ended.
-
– test:didLog:source:Test logged a message.
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)runReturn Value
0 is success, otherwise the failure count
Declared In
GHTestRunner.hrunnerForAllTests
Create runner for all tests.
+ (GHTestRunner *)runnerForAllTestsReturn Value
Runner
See Also
Declared In
GHTestRunner.hrunnerForSuite:
Create runner for test suite.
+ (GHTestRunner *)runnerForSuite:(GHTestSuite *)suiteParameters
- suite
Suite
Return Value
Runner
Declared In
GHTestRunner.hrunnerForTestClassName:methodName:
Create runner for class and method.
+ (GHTestRunner *)runnerForTestClassName:(NSString *)testClassName methodName:(NSString *)methodNameParameters
- testClassName
Test class name
- methodName
Test method
Return Value
Runner
Declared In
GHTestRunner.hrunnerFromEnv
Get the runner from the environment. If the TEST env is set, then we will only run that test case or test method.
+ (GHTestRunner *)runnerFromEnvDeclared In
GHTestRunner.hInstance Methods
initWithTest:
Create runner for test.
- (id)initWithTest:(id<GHTest>)testParameters
- test
Test
Declared In
GHTestRunner.hlog:
Write message to console.
- (void)log:(NSString *)messageParameters
- message
Message to log
Declared In
GHTestRunner.hrunTests
Start the test runner.
- (int)runTestsReturn Value
0 is success, otherwise the failure count
Declared In
GHTestRunner.htest:didLog:source:
Test logged a message.
- (void)test:(id<GHTest>)test didLog:(NSString *)message source:(id<GHTest>)sourceParameters
- test
Test
- didLog
Message
- source
If tests are nested, than source corresponds to the originator of the delegate call
Declared In
GHTest.htestDidEnd:source:
Test ended.
- (void)testDidEnd:(id<GHTest>)test source:(id<GHTest>)sourceParameters
- test
Test
- source
If tests are nested, than source corresponds to the originator of the delegate call
Declared In
GHTest.h