CppUnit project page FAQ CppUnit home page

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CppUnit::TestResultCollector Class Reference
[Writing test resultBrowsing collected test result]

Collects test result. More...

#include <TestResultCollector.h>

Inheritance diagram for CppUnit::TestResultCollector:

CppUnit::TestSucessListener CppUnit::TestListener CppUnit::SynchronizedObject CppUnit::TextTestResult List of all members.

Public Types

typedef std::deque< TestFailure * > TestFailures
typedef std::deque< Test * > Tests

Public Methods

 TestResultCollector (SynchronizationObject *syncObject=0)
virtual ~TestResultCollector ()
 Destructor. More...

void startTest (Test *test)
 Called when just before a TestCase is run. More...

void addFailure (const TestFailure &failure)
virtual void reset ()
virtual int runTests () const
 Gets the number of run tests. More...

virtual int testErrors () const
 Gets the number of detected errors (uncaught exception). More...

virtual int testFailures () const
 Gets the number of detected failures (failed assertion). More...

virtual int testFailuresTotal () const
 Gets the total number of detected failures. More...

virtual const TestFailuresfailures () const
 Returns a the list failures (random access collection). More...

virtual const Teststests () const

Protected Attributes

Tests m_tests
TestFailures m_failures
int m_testErrors

Private Methods

 TestResultCollector (const TestResultCollector &copy)
 Prevents the use of the copy constructor. More...

void operator= (const TestResultCollector &copy)
 Prevents the use of the copy operator. More...


Detailed Description

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.

See also:
TestListener, TestFailure.


Member Typedef Documentation

typedef std::deque<TestFailure *> CppUnit::TestResultCollector::TestFailures
 

typedef std::deque<Test *> CppUnit::TestResultCollector::Tests
 


Constructor & Destructor Documentation

CppUnit::TestResultCollector::TestResultCollector SynchronizationObject *    syncObject = 0
 

Constructs a TestResultCollector object.

CppUnit::TestResultCollector::~TestResultCollector   [virtual]
 

Destructor.

CppUnit::TestResultCollector::TestResultCollector const TestResultCollector &    copy [private]
 

Prevents the use of the copy constructor.


Member Function Documentation

void CppUnit::TestResultCollector::addFailure const TestFailure   failure [virtual]
 

Called when a failure occurs while running a test.

See also:
TestFailure.
Warning:
failure is a temporary object that is destroyed after the method call. Use TestFailure::clone() to create a duplicate.

Reimplemented from CppUnit::TestSucessListener.

Reimplemented in CppUnit::TextTestResult.

const TestResultCollector::TestFailures & CppUnit::TestResultCollector::failures   const [virtual]
 

Returns a the list failures (random access collection).

void CppUnit::TestResultCollector::operator= const TestResultCollector &    copy [private]
 

Prevents the use of the copy operator.

void CppUnit::TestResultCollector::reset   [virtual]
 

Reimplemented from CppUnit::TestSucessListener.

int CppUnit::TestResultCollector::runTests   const [virtual]
 

Gets the number of run tests.

void CppUnit::TestResultCollector::startTest Test   test [virtual]
 

Called when just before a TestCase is run.

Reimplemented from CppUnit::TestListener.

Reimplemented in CppUnit::TextTestResult.

int CppUnit::TestResultCollector::testErrors   const [virtual]
 

Gets the number of detected errors (uncaught exception).

int CppUnit::TestResultCollector::testFailures   const [virtual]
 

Gets the number of detected failures (failed assertion).

int CppUnit::TestResultCollector::testFailuresTotal   const [virtual]
 

Gets the total number of detected failures.

const TestResultCollector::Tests & CppUnit::TestResultCollector::tests   const [virtual]
 


Member Data Documentation

TestFailures CppUnit::TestResultCollector::m_failures [protected]
 

int CppUnit::TestResultCollector::m_testErrors [protected]
 

Tests CppUnit::TestResultCollector::m_tests [protected]
 


The documentation for this class was generated from the following files:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers