Name
TestResultCollector
Description
The class TestResultCollector
(see Figure C-27)
collects test results that it receives from a
TestResult
via the TestListener
interface. The results consist of the Test
objects
run and any failures or errors produced.
A TestResultCollector
is a
SynchronizedObject
. Its operations are
mutex-protected and thread-safe.
TestResultCollector
belongs to the namespace
CppUnit
. It is declared in
TestResultCollector.h and implemented in
TestResultCollector.cpp.
Declaration
class TestResultCollector : public TestSucessListener
Constructors/Destructors
-
TestResultCollector(SynchronizationObject *syncObject = 0)
A constructor. If a
SynchronizationObject
is not provided, a new one is created.-
virtual ~TestResultCollector( )
A destructor.
Public Methods
-
void addFailure(const TestFailure &failure)
A method that informs
TestResultCollector
of aTestFailure
.-
virtual const TestFailures& failures( ) const
Returns
m_failures
, theTestFailure
objects collected by thisTestResultCollector
.-
virtual void reset( )
Clears the collected results.
-
virtual int runTests( ) const
Returns the number of
Test
objects run.-
void startTest(Test *test)
A method that informs
TestResultCollector
thattest
is about to be run.-
virtual int testErrors( ) const
Returns the number of test errors collected.
-
virtual int testFailures( ) const
Returns the number ...
Get Unit Test Frameworks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.