summaryrefslogtreecommitdiff
path: root/include/cppunit
diff options
context:
space:
mode:
Diffstat (limited to 'include/cppunit')
-rw-r--r--include/cppunit/Exception.h3
-rw-r--r--include/cppunit/TestResult.h2
-rw-r--r--include/cppunit/TextTestRunner.h28
3 files changed, 21 insertions, 12 deletions
diff --git a/include/cppunit/Exception.h b/include/cppunit/Exception.h
index f94eca5..a051ce9 100644
--- a/include/cppunit/Exception.h
+++ b/include/cppunit/Exception.h
@@ -46,7 +46,8 @@ public:
Exception& operator= (const Exception& other);
- const char *what() const throw ();
+// const char *what() const throw ();
+ const char *what() const;
SourceLine sourceLine() const;
diff --git a/include/cppunit/TestResult.h b/include/cppunit/TestResult.h
index dfb3889..855be27 100644
--- a/include/cppunit/TestResult.h
+++ b/include/cppunit/TestResult.h
@@ -50,6 +50,8 @@ class TestResult
TestResult( SynchronizationObject *syncObject =0 );
virtual ~TestResult();
+ virtual void reset();
+
virtual void addError( Test *test, Exception *e );
virtual void addFailure( Test *test, Exception *e );
virtual void startTest( Test *test );
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