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
SynchronizationObjectis not provided, a new one is created.-
virtual ~TestResultCollector( ) A destructor.
Public Methods
-
void addFailure(const TestFailure &failure) A method that informs
TestResultCollectorof aTestFailure.-
virtual const TestFailures& failures( ) const Returns
m_failures, theTestFailureobjects collected by thisTestResultCollector.-
virtual void reset( ) Clears the collected results.
-
virtual int runTests( ) const Returns the number of
Testobjects run.-
void startTest(Test *test) A method that informs
TestResultCollectorthattestis about to be run.-
virtual int testErrors( ) const Returns the number of test errors collected.
-
virtual int testFailures( ) const Returns the number ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
