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  

TestRunner.h

Go to the documentation of this file.
00001 #ifndef CPPUNITUI_TEXT_TESTRUNNER_H
00002 #define CPPUNITUI_TEXT_TESTRUNNER_H
00003 
00004 #include <cppunit/Portability.h>
00005 #include <string>
00006 #include <vector>
00007 
00008 namespace CppUnit {
00009 
00010 class Outputter;
00011 class Test;
00012 class TestSuite;
00013 class TextOutputter;
00014 class TestResult;
00015 class TestResultCollector;
00016 
00017 namespace TextUi
00018 {
00019 
00062 class CPPUNIT_API TestRunner
00063 {
00064 public:
00065   TestRunner( Outputter *outputter =NULL );
00066 
00067   virtual ~TestRunner();
00068 
00069   bool run( std::string testName ="",
00070             bool doWait = false,
00071             bool doPrintResult = true,
00072             bool doPrintProgress = true );
00073 
00074   void addTest( Test *test );
00075 
00076   void setOutputter( Outputter *outputter );
00077 
00078   TestResultCollector &result() const;
00079 
00080   TestResult &eventManager() const;
00081 
00082 protected:
00083   virtual bool runTest( Test *test,
00084                         bool doPrintProgress );
00085   virtual bool runTestByName( std::string testName,
00086                               bool printProgress );
00087   virtual void wait( bool doWait );
00088   virtual void printResult( bool doPrintResult );
00089 
00090   virtual Test *findTestByName( std::string name ) const;
00091 
00092   TestSuite *m_suite;
00093   TestResultCollector *m_result;
00094   TestResult *m_eventManager;
00095   Outputter *m_outputter;
00096 };
00097 
00098 
00099 } // namespace TextUi
00100 
00101 } // namespace CppUnit
00102 
00103 #endif  // CPPUNITUI_TEXT_TESTRUNNER_H

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