CppUnit project page | FAQ | CppUnit home page |
Collects test result.A TestResultCollector is a TestListener which collects the results of executing a test case. It is an instance of the Collecting Parameter pattern. More...
#include <TestResultCollector.h>
Public Types | |
typedef CppUnitDeque < TestFailure * > | TestFailures |
typedef CppUnitDeque< Test * > | Tests |
Public Member Functions | |
TestResultCollector (SynchronizationObject *syncObject=0) | |
virtual | ~TestResultCollector () |
Destructor. | |
void | startTest (Test *test) |
Called when just before a TestCase is run. | |
void | addFailure (const TestFailure &failure) |
Called when a failure occurs while running a test. | |
virtual void | reset () |
virtual int | runTests () const |
Gets the number of run tests. | |
virtual int | testErrors () const |
Gets the number of detected errors (uncaught exception). | |
virtual int | testFailures () const |
Gets the number of detected failures (failed assertion). | |
virtual int | testFailuresTotal () const |
Gets the total number of detected failures. | |
virtual const TestFailures & | failures () const |
Returns a the list failures (random access collection). | |
virtual const Tests & | tests () const |
Protected Member Functions | |
void | freeFailures () |
Protected Attributes | |
Tests | m_tests |
TestFailures | m_failures |
int | m_testErrors |
Private Member Functions | |
TestResultCollector (const TestResultCollector ©) | |
Prevents the use of the copy constructor. | |
void | operator= (const TestResultCollector ©) |
Prevents the use of the copy operator. |
Collects test result.
A TestResultCollector is a TestListener which collects the results of executing a test case. It is an instance of the Collecting Parameter pattern.
The test framework distinguishes between failures and errors. A failure is anticipated and checked for with assertions. Errors are unanticipated problems signified by exceptions that are not generated by the framework.
typedef CppUnitDeque<TestFailure *> TestResultCollector::TestFailures |
typedef CppUnitDeque<Test *> TestResultCollector::Tests |
CPPUNIT_NS_BEGIN TestResultCollector::TestResultCollector | ( | SynchronizationObject * | syncObject = 0 | ) |
Constructs a TestResultCollector object.
TestResultCollector::~TestResultCollector | ( | ) | [virtual] |
Destructor.
TestResultCollector::TestResultCollector | ( | const TestResultCollector & | copy | ) | [private] |
Prevents the use of the copy constructor.
void TestResultCollector::addFailure | ( | const TestFailure & | ) | [virtual] |
Called when a failure occurs while running a test.
Reimplemented from TestSuccessListener.
Reimplemented in TextTestResult.
const TestResultCollector::TestFailures & TestResultCollector::failures | ( | ) | const [virtual] |
Returns a the list failures (random access collection).
void TestResultCollector::freeFailures | ( | ) | [protected] |
void TestResultCollector::operator= | ( | const TestResultCollector & | copy | ) | [private] |
Prevents the use of the copy operator.
void TestResultCollector::reset | ( | ) | [virtual] |
Reimplemented from TestSuccessListener.
int TestResultCollector::runTests | ( | ) | const [virtual] |
Gets the number of run tests.
void TestResultCollector::startTest | ( | Test * | ) | [virtual] |
Called when just before a TestCase is run.
Reimplemented from TestListener.
Reimplemented in TextTestResult.
int TestResultCollector::testErrors | ( | ) | const [virtual] |
Gets the number of detected errors (uncaught exception).
int TestResultCollector::testFailures | ( | ) | const [virtual] |
Gets the number of detected failures (failed assertion).
int TestResultCollector::testFailuresTotal | ( | ) | const [virtual] |
Gets the total number of detected failures.
const TestResultCollector::Tests & TestResultCollector::tests | ( | ) | const [virtual] |
TestFailures TestResultCollector::m_failures [protected] |
int TestResultCollector::m_testErrors [protected] |
Tests TestResultCollector::m_tests [protected] |
|
hosts this site. |
Send comments to: CppUnit Developers |