TestLog

Inherits from:
Declared In:

Overview

TestObserver that logs the execution of a test run as text.

Discussion

A TestLog is a TestObserver that has a std::ostream on which it logs the executon of a test run as text. It writes a line of text for test start, test stop, test failure, test suite start, and test suite stop. When it writes a line of text for test failure, it outputs that line in a compiler-like format so the failure information can be easily parsed.



Functions

testDidFail

Logs that the input Test failed execution.

testDidStart

Logs that the input Test started execution.

testDidStop

Logs that the input Test completed execution.

TestLog

Constructor for the TestLog class, takes the stream to log to.

testSuiteDidStart

Logs that the input TestSuite started execution.

testSuiteDidStop

Logs that the input TestSuite completed execution.

~TestLog

Destructor for the TestLog class.


testDidFail


Logs that the input Test failed execution.

public

virtual void testDidFail( Test& test, const TestFailure& failure);
Parameters
test

The Test that failed execution.

failure

Information about why the Test failed.

Discussion

Logs that the input Test failed execution, and includes information about the failure. This information is formatted in a compiler-like format including the source code file name and line number, followed by an informative message.


testDidStart


Logs that the input Test started execution.

public

virtual void testDidStart( Test& test);
Parameters
test

The Test that started execution.

Discussion

Logs that the input Test started execution.


testDidStop


Logs that the input Test completed execution.

public

virtual void testDidStop( Test& test);
Parameters
test

The Test that completed execution.

Discussion

Logs that the input Test completed execution. Tests either complete or fail, they don't do both.


TestLog


Constructor for the TestLog class, takes the stream to log to.

public

explicit TestLog( std::ostream& stream);
Parameters
stream

The stream to log test execution to. Pass std::cerr to log to standard error.

Discussion

Constructor for the TestLog class. Its parameter is the stream to log test execution to.


testSuiteDidStart


Logs that the input TestSuite started execution.

public

virtual void testSuiteDidStart( TestSuite& testSuite);
Parameters
testSuite

The TestSuite that started execution.

Discussion

Logs that the input TestSuite started execution.


testSuiteDidStop


Logs that the input TestSuite completed execution.

public

virtual void testSuiteDidStop( TestSuite& testSuite);
Parameters
test

The TestSuite that completed execution.

Discussion

Logs that the input TestSuite completed execution. TestSuites always complete, regardless of whether any of their compenent tests fail.


~TestLog


Destructor for the TestLog class.

public

virtual ~TestLog();
Discussion

Destructor for the TestLog class.

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-08-12