Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC
ADC Home > Reference Library > Reference > Tools > Xcode > CPlusTest Reference

 


TestObserver

Declared In:

Overview

Abstract base class for objects that can observe the execution of tests.

Discussion

A TestObserver can be added to a TestRun to observe the execution of tests as they run and track their progress. It will be notified when tests start, stop, and fail, as well as when test suites start and stop.



Functions

testDidFail
Informs the observer that the input Test failed execution, and of information about the failure.
testDidStart
Informs the observer that the input Test started execution.
testDidStop
Informs the observer that the input Test completed execution.
TestObserver
Constructor for the TestObserver class.
testSuiteDidStart
Informs the observer that the input TestSuite started execution.
testSuiteDidStop
Informs the observer that the input TestSuite completed execution.
~TestObserver
Destructor for the TestObserver class.

testDidFail


Informs the observer that the input Test failed execution, and of information about the failure.

public

virtual void testDidFail( Test& test, const TestFailure& failure) = 0;
Parameters
test
The Test that failed execution.
failure
Information about why the Test failed.
Discussion

Informs the observer that the input Test failed execution, and of information about the failure. This information includes source code file name and line number, as well as an informative message. A Test can either complete (stop) or fail, not both.


testDidStart


Informs the observer that the input Test started execution.

public

virtual void testDidStart( Test& test) = 0;
Parameters
test
The Test that started execution.
Discussion

Informs the observer that the input Test started execution.


testDidStop


Informs the observer that the input Test completed execution.

public

virtual void testDidStop( Test& test) = 0;
Parameters
test
The Test that completed execution.
Discussion

Informs the observer that the input Test completed execution. A Test only completes if it did not fail.


TestObserver


Constructor for the TestObserver class.

public

TestObserver();
Discussion

Constructor for the TestObserver class.


testSuiteDidStart


Informs the observer that the input TestSuite started execution.

public

virtual void testSuiteDidStart( TestSuite& testSuite) = 0;
Parameters
testSuite
The TestSuite that started execution.
Discussion

Informs the observer that the input TestSuite started execution.


testSuiteDidStop


Informs the observer that the input TestSuite completed execution.

public

virtual void testSuiteDidStop( TestSuite& testSuite) = 0;
Parameters
testSuite
The TestSuite that completed execution.
Discussion

Informs the observer that the input TestSuite completed execution. TestSuites always complete, regardless of whether any of their component Tests fail.


~TestObserver


Destructor for the TestObserver class.

public

virtual ~TestObserver();
Discussion

Destructor for the TestObserver class.




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11