diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-06 09:16:31 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-06 09:16:31 +0000 |
| commit | 4c6c7e6474bef34c4bed0d3eb9889012319c938f (patch) | |
| tree | 8c92755d5109834b78ea620a224fd2ef75abeb09 /include/cppunit/TextTestRunner.h | |
| parent | fbd454f554f13680fe62b36fb7a5829f6dc0c396 (diff) | |
| download | cppunit-4c6c7e6474bef34c4bed0d3eb9889012319c938f.tar.gz | |
Examples/cppunittest/CppUnitTestMain.
examples/cppunittest/CppUnitTestMain.cpp : application returns
0 is test suite run sucessfuly, 1 otherwise.
* src/cppunit/Exception.cpp : bug fix, operator =() with VC++.
Removed call to std::exception::operator =() which is bugged
on VC++.
* doc/FAQ : added a note explaining why the test
ExceptionTest.testAssignment used to fail.
* NEWS : updated and detailed.
* include/cppunit/TestResult.h :
* src/cppunit/TestResult.cpp : added reset().
* include/cppunit/TextTestRunner.h :
* src/cppunit/TextTestRunner.cpp : Constructor take an optional
TextTestRestult. The TextTestResult remain alive as long as
the runner. Added result() to retreive the result. Printing the
result is now optinal (enabled by default).
Diffstat (limited to 'include/cppunit/TextTestRunner.h')
| -rw-r--r-- | include/cppunit/TextTestRunner.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/include/cppunit/TextTestRunner.h b/include/cppunit/TextTestRunner.h index 5c5180d..e44f68d 100644 --- a/include/cppunit/TextTestRunner.h +++ b/include/cppunit/TextTestRunner.h @@ -8,6 +8,7 @@ namespace CppUnit { class Test; class TestSuite; +class TextTestResult; /** * A text mode test runner. @@ -30,21 +31,26 @@ class TestSuite; class TextTestRunner { public: - TextTestRunner(); - virtual ~TextTestRunner(); + TextTestRunner( TextTestResult *result =0 ); + virtual ~TextTestRunner(); - bool run( std::string testName ="", - bool wait = false ); + bool run( std::string testName ="", + bool wait = false, + bool printResult = true ); - void addTest( Test *test ); + void addTest( Test *test ); -protected: - bool runTest( Test *test ); - bool runTestByName( std::string testName ); - void wait( bool doWait ); + TextTestResult *result(); - Test *findTestByName( std::string name ) const; - TestSuite *m_suite; +protected: + bool runTest( Test *test ); + bool runTestByName( std::string testName ); + void wait( bool doWait ); + void printResult( bool doPrintResult ); + + Test *findTestByName( std::string name ) const; + TestSuite *m_suite; + TextTestResult *m_result; }; } // namespace CppUnit |
