diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-06-01 18:34:42 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-06-01 18:34:42 +0000 |
| commit | 8c24e60a1c43fc24ee65618155795037770b5196 (patch) | |
| tree | 753bbfb0a0ddf015a9694e6ae3890bc0ca84f5de /include/cppunit | |
| parent | bc6338edfd9b10327c83142fef1e427c5cb3e80f (diff) | |
| download | cppunit-8c24e60a1c43fc24ee65618155795037770b5196.tar.gz | |
Added project cppunittest to examples/: unit tests to test cppunit.
added project cppunittest to examples/: unit tests to test cppunit. The
main file is CppUnitTestMain.cpp. Unit tests have been implemented
for TestCaller and TestListener.
* added project CppUnitTestApp to examples/msvc6: graphical runner for
cppunittest.
* added TestListener to TestResult. It is a port of junit TestListener.
* updated some .cvsignore to ignore files generated with VC++.
Diffstat (limited to 'include/cppunit')
| -rw-r--r-- | include/cppunit/Makefile.am | 3 | ||||
| -rw-r--r-- | include/cppunit/TestListener.h | 29 | ||||
| -rw-r--r-- | include/cppunit/TestResult.h | 5 |
3 files changed, 36 insertions, 1 deletions
diff --git a/include/cppunit/Makefile.am b/include/cppunit/Makefile.am index b300459..a5f31ef 100644 --- a/include/cppunit/Makefile.am +++ b/include/cppunit/Makefile.am @@ -12,5 +12,6 @@ libcppunitinclude_HEADERS = \ TestRegistry.h \ TestSuite.h \ TextTestResult.h \ - TextTestRunner.h + TextTestRunner.h \ + TestListener.h diff --git a/include/cppunit/TestListener.h b/include/cppunit/TestListener.h new file mode 100644 index 0000000..31fd8ea --- /dev/null +++ b/include/cppunit/TestListener.h @@ -0,0 +1,29 @@ +#ifndef CPPUNIT_TESTLISTENER_H +#define CPPUNIT_TESTLISTENER_H + +namespace CppUnit { + + class Exception; + class Test; + + + /** + * A Listener for test progress + * \see TestResult + */ + class TestListener + { + public: + virtual ~TestListener() {} + + virtual void addError( Test *test, Exception *e ) {} + virtual void addFailure( Test *test, Exception *e ) {} + virtual void startTest( Test *test ) {} + virtual void endTest( Test *test ) {} + }; + +} // namespace CppUnit + +#endif // CPPUNIT_TESTLISTENER_H + + diff --git a/include/cppunit/TestResult.h b/include/cppunit/TestResult.h index 1c02d52..75fe3ee 100644 --- a/include/cppunit/TestResult.h +++ b/include/cppunit/TestResult.h @@ -8,6 +8,7 @@ namespace CppUnit { class Exception; class Test; + class TestListener; /** @@ -51,6 +52,9 @@ namespace CppUnit { virtual std::vector<TestFailure *>& errors (); virtual std::vector<TestFailure *>& failures (); + virtual void addListener ( TestListener *listener ); + virtual void removeListener ( TestListener *listener ); + class SynchronizationObject { @@ -80,6 +84,7 @@ namespace CppUnit { std::vector<TestFailure *> m_errors; std::vector<TestFailure *> m_failures; + std::vector<TestListener *> m_listeners; int m_runTests; bool m_stop; SynchronizationObject *m_syncObject; |
