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

TestResultCollector.h

Go to the documentation of this file.
00001 #ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
00002 #define CPPUNIT_TESTRESULTCOLLECTOR_H
00003 
00004 #include <cppunit/Portability.h>
00005 
00006 #if CPPUNIT_NEED_DLL_DECL
00007 #pragma warning( push )
00008 #pragma warning( disable: 4251 )  // X needs to have dll-interface to be used by clients of class Z
00009 #endif
00010 
00011 #include <cppunit/TestSucessListener.h>
00012 #include <deque>
00013 
00014 
00015 namespace CppUnit
00016 {
00017 
00018 
00019 #if CPPUNIT_NEED_DLL_DECL
00020   template class CPPUNIT_API std::deque<TestFailure *>;
00021   template class CPPUNIT_API std::deque<Test *>;
00022 #endif
00023 
00024 
00038 class CPPUNIT_API TestResultCollector : public TestSucessListener
00039 {
00040 public:
00041   typedef std::deque<TestFailure *> TestFailures;
00042   typedef std::deque<Test *> Tests;
00043 
00044 
00047   TestResultCollector( SynchronizationObject *syncObject = 0 );
00048 
00050   virtual ~TestResultCollector();
00051 
00052   void startTest( Test *test );
00053   void addFailure( const TestFailure &failure );
00054 
00055   virtual void reset();
00056 
00057   virtual int runTests() const;
00058   virtual int testErrors() const;
00059   virtual int testFailures() const;
00060   virtual int testFailuresTotal() const;
00061 
00062   virtual const TestFailures& failures() const;
00063   virtual const Tests &tests() const;
00064 
00065 protected:
00066   Tests m_tests;
00067   TestFailures m_failures;
00068   int m_testErrors;
00069 
00070 private:
00072   TestResultCollector( const TestResultCollector &copy );
00073 
00075   void operator =( const TestResultCollector &copy );
00076 };
00077 
00078 
00079 
00080 } //  namespace CppUnit
00081 
00082 
00083 #if CPPUNIT_NEED_DLL_DECL
00084 #pragma warning( pop )
00085 #endif
00086 
00087 
00088 #endif  // CPPUNIT_TESTRESULTCOLLECTOR_H

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers