CppUnit project page FAQ

TestResultCollector.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
2 #define CPPUNIT_TESTRESULTCOLLECTOR_H
3 
4 #include <cppunit/Portability.h>
5 
6 #if CPPUNIT_NEED_DLL_DECL
7 #pragma warning( push )
8 #pragma warning( disable: 4251 4660 ) // X needs to have dll-interface to be used by clients of class Z
9 #endif
10 
12 #include <deque>
13 
14 
16 
17 
32 {
33 public:
34  typedef std::deque<TestFailure *> TestFailures;
35  typedef std::deque<Test *> Tests;
36 
37 
40  TestResultCollector( SynchronizationObject *syncObject = 0 );
41 
43  virtual ~TestResultCollector();
44 
45  void startTest( Test *test );
46  void addFailure( const TestFailure &failure );
47 
48  virtual void reset();
49 
50  virtual int runTests() const;
51  virtual int testErrors() const;
52  virtual int testFailures() const;
53  virtual int testFailuresTotal() const;
54 
55  virtual const TestFailures& failures() const;
56  virtual const Tests &tests() const;
57 
58 protected:
59  void freeFailures();
60 
64 
65 private:
68 
70  void operator =( const TestResultCollector &copy );
71 };
72 
73 
74 
76 
77 #if CPPUNIT_NEED_DLL_DECL
78 #pragma warning( pop )
79 #endif
80 
81 
82 #endif // CPPUNIT_TESTRESULTCOLLECTOR_H
#define CPPUNIT_API
Definition: CppUnitApi.h:27
#define CPPUNIT_NS_END
Definition: Portability.h:106
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:105
Abstract synchronization object (mutex)
Definition: SynchronizedObject.h:28
void operator=(const SynchronizedObject &copy)
Prevents the use of the copy operator.
Record of a failed Test execution.
Definition: TestFailure.h:25
Base class for all test objects.
Definition: Test.h:26
virtual void startTest(Test *)
Called when just before a TestCase is run.
Definition: TestListener.h:100
Collects test result.
Definition: TestResultCollector.h:32
int m_testErrors
Definition: TestResultCollector.h:63
Tests m_tests
Definition: TestResultCollector.h:61
std::deque< Test * > Tests
Definition: TestResultCollector.h:35
TestResultCollector(const TestResultCollector &copy)
Prevents the use of the copy constructor.
std::deque< TestFailure * > TestFailures
Definition: TestResultCollector.h:34
TestFailures m_failures
Definition: TestResultCollector.h:62
TestListener that checks if any test case failed.
Definition: TestSuccessListener.h:16
void addFailure(const TestFailure &failure)
Called when a failure occurs while running a test.
Definition: TestSuccessListener.cpp:28
virtual void reset()
Definition: TestSuccessListener.cpp:20

Send comments to:
CppUnit Developers