Copyright: (C) 2004 James Duncan Davidson, Michael Milvich, Mark Dalrymple, Nicolas Roard, Quentin Mathe
- Declared in:
- UKTestHandler.h
@abstract UKTestHandler implements the test assertions built into UnitKit and track the test results
For each test assertion invoked on the test handler, the handler collects the result and reports it or not based on the reporting settings.
At any time, you can query the current test results using -testsPassed , -testsFailed and -exceptionsReported , for all the test assertions invoked since the test handler has been created.
A single test handler exists for all UKRunner instances. For multiple run test requests against UKRunner instances, all test results are reported together.
@taskunit Controlling Test Result Reporting
Returns a delegate that can implement the same reporting methods than UKTestHandler.
By default, returns nil
.
For more details, see -setDelegate: .
Returns the current number of exceptions caught by UKRunner and reported to the test handler.
See -reportException:inClass:hint: .
Returns whether the handler should report just the test failures and uncaught exceptions, but nothing on test successes.
By default, returns NO
.
-isQuiet
is initialized to YES
if the argument
-q
is
present in the ukrun arguments.
@taskunit Basic Test Assertions
@taskunit Exception Test Assertions
Reports an uncaught exception and a hint that represents the context in which the exception was raised.
To indicate the context, three hints are supported:
By default, forwards the message to the delegate if there is one, otherwise uses -reportWarning: to print the exception reason.
If we have a delegate, then by all means use it. If we don't, then check to see if we have any errors which should be reported off to std out.
Reports a warning message.
By default, forwards the message to the delegate if there is one, otherwise uses NSLog() to print the message.
This method is used by -reportStatus:inFile:line:message: and -reportException:inClass:hint: to report test failures and uncaught exceptions.
Sets a delegate that can implement the same reporting methods than UKTestHandler.
If the delegate implements a reporting method, it takes priority over UKTestHandler. As a result, what was previously reported by UKTestHandler is not going to be automatically logged in the console unless the delegate does it.
Tells the handler to report just the test failures and uncaught exceptions, but nothing on test successes.
@taskunit Number Primitive Test Assertions
@taskunit Object Test Assertions
@taskunit String Test Assertions
@taskunit Primitive Test Assertions
@taskunit Test Results
Returns the current number of test successes.
See -reportStatus:inFile:line:message: .