CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class 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 4660 )  // X needs to have dll-interface to be used by clients of class Z
00009 #endif
00010 
00011 #include <cppunit/TestSuccessListener.h>
00012 #include <cppunit/portability/CppUnitDeque.h>
00013 
00014 
00015 CPPUNIT_NS_BEGIN
00016 
00017 #if CPPUNIT_NEED_DLL_DECL
00018 //  template class CPPUNIT_API std::deque<TestFailure *>;
00019 //  template class CPPUNIT_API std::deque<Test *>;
00020 #endif
00021 
00022 
00036 class CPPUNIT_API TestResultCollector : public TestSuccessListener
00037 {
00038 public:
00039   typedef CppUnitDeque<TestFailure *> TestFailures;
00040   typedef CppUnitDeque<Test *> Tests;
00041 
00042 
00045   TestResultCollector( SynchronizationObject *syncObject = 0 );
00046 
00048   virtual ~TestResultCollector();
00049 
00050   void startTest( Test *test );
00051   void addFailure( const TestFailure &failure );
00052 
00053   virtual void reset();
00054 
00055   virtual int runTests() const;
00056   virtual int testErrors() const;
00057   virtual int testFailures() const;
00058   virtual int testFailuresTotal() const;
00059 
00060   virtual const TestFailures& failures() const;
00061   virtual const Tests &tests() const;
00062 
00063 protected:
00064   void freeFailures();
00065 
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 CPPUNIT_NS_END
00081 
00082 #if CPPUNIT_NEED_DLL_DECL
00083 #pragma warning( pop )
00084 #endif
00085 
00086 
00087 #endif  // CPPUNIT_TESTRESULTCOLLECTOR_H

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