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 }
00100
00101 }
00102
00103 #endif // CPPUNITUI_TEXT_TESTRUNNER_H