CppUnit project page FAQ

TestResult.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_TESTRESULT_H
2 #define CPPUNIT_TESTRESULT_H
3 
4 #include <cppunit/Portability.h>
5 
6 #if CPPUNIT_NEED_DLL_DECL
7 #pragma warning( push )
8 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
9 #endif
10 
12 #include <deque>
13 #include <string>
14 
16 
17 
18 class Exception;
19 class Functor;
20 class Protector;
21 class ProtectorChain;
22 class Test;
23 class TestFailure;
24 class TestListener;
25 
26 
48 {
49 public:
51  TestResult( SynchronizationObject *syncObject = 0 );
52 
54  virtual ~TestResult();
55 
56  virtual void addListener( TestListener *listener );
57 
58  virtual void removeListener( TestListener *listener );
59 
61  virtual void reset();
62 
64  virtual void stop();
65 
67  virtual bool shouldStop() const;
68 
70  virtual void startTest( Test *test );
71 
76  virtual void addError( Test *test, Exception *e );
77 
81  virtual void addFailure( Test *test, Exception *e );
82 
84  virtual void endTest( Test *test );
85 
87  virtual void startSuite( Test *test );
88 
90  virtual void endSuite( Test *test );
91 
96  virtual void runTest( Test *test );
97 
113  virtual bool protect( const Functor &functor,
114  Test *test,
115  const std::string &shortDescription = std::string("") );
116 
118  virtual void pushProtector( Protector *protector );
119 
121  virtual void popProtector();
122 
123 protected:
126  void addFailure( const TestFailure &failure );
127 
128  virtual void startTestRun( Test *test );
129  virtual void endTestRun( Test *test );
130 
131 protected:
132  typedef std::deque<TestListener *> TestListeners;
135  bool m_stop;
136 
137 private:
138  TestResult( const TestResult &other );
139  TestResult &operator =( const TestResult &other );
140 };
141 
142 
144 
145 
146 #if CPPUNIT_NEED_DLL_DECL
147 #pragma warning( pop )
148 #endif
149 
150 #endif // CPPUNIT_TESTRESULT_H
151 
152 

Send comments to:
CppUnit Developers