diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-06 11:03:30 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-10-06 11:03:30 +0000 |
| commit | 8ac4da778cb226fb00b413a047ad3480f4d2ae5a (patch) | |
| tree | 1c239ed54fb94b0ba2c329e7d7e177de4219d4b7 /include/cppunit | |
| parent | 4c6c7e6474bef34c4bed0d3eb9889012319c938f (diff) | |
| download | cppunit-8ac4da778cb226fb00b413a047ad3480f4d2ae5a.tar.gz | |
Include/cppunit/CompilerTestResultOutputter.
include/cppunit/CompilerTestResultOutputter.h :
* src/cppunit/CompilerTestResultOutputter.cpp : added. Output result
in a compiler compatible format.
* src/cppunit/CppUnit.dsp :
* include/cppunit/MakeFile.am :
* src/cppunit/MakeFile.am : added CompilerTestResultOutputter.cpp
and CompilerTestResultOutputter.h.
* examples/cppunittest/CppUnitTestMain.cpp : if -selftest is specified
on the command line, no standard test result are printed, but compiler
compatible result at printed.
* examples/cppunittest/CppUnitTestMain.dsp : added post-build step to
run the test suite with -selftest.
* NEWS : updated.
* src/cppunit/TextTestRunner.cpp : skip a line after printing
progress.
Diffstat (limited to 'include/cppunit')
| -rw-r--r-- | include/cppunit/CompilerTestResultOutputter.h | 62 | ||||
| -rw-r--r-- | include/cppunit/Makefile.am | 1 |
2 files changed, 63 insertions, 0 deletions
diff --git a/include/cppunit/CompilerTestResultOutputter.h b/include/cppunit/CompilerTestResultOutputter.h new file mode 100644 index 0000000..8c4514c --- /dev/null +++ b/include/cppunit/CompilerTestResultOutputter.h @@ -0,0 +1,62 @@ +#ifndef CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H +#define CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H + +#include <cppunit/Portability.h> +#include <iostream> + +namespace CppUnit +{ + +class Exception; +class SourceLine; +class Test; +class TestFailure; +class TestResult; + +/*! \class CompilerTestResultOutputter + * \brief This class implements output test result in a compiler compatible format. + */ +class CompilerTestResultOutputter +{ +public: + /*! Constructs a CompilerTestResultOutputter object. + */ + CompilerTestResultOutputter( TestResult *result, + std::ostream &stream ); + + /// Destructor. + virtual ~CompilerTestResultOutputter(); + + virtual void write( ); + + virtual void printSucess(); + virtual void printFailureReport(); + virtual void printFailuresList(); + virtual void printStatistics(); + virtual void printFailureDetail( TestFailure *failure ); + virtual void printFailureLocation( SourceLine sourceLine ); + virtual void printFailureType( TestFailure *failure ); + virtual void printFailedTestName( TestFailure *failure ); + virtual void printFailureMessage( TestFailure *failure ); + virtual void printNotEqualMessage( Exception *thrownException ); + virtual void printDefaultMessage( Exception *thrownException ); + virtual std::string wrap( std::string message ); + +private: + /// Prevents the use of the copy constructor. + CompilerTestResultOutputter( const CompilerTestResultOutputter © ); + + /// Prevents the use of the copy operator. + void operator =( const CompilerTestResultOutputter © ); + +private: + TestResult *m_result; + std::ostream &m_stream; +}; + + +} // namespace CppUnit + + + +#endif // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H diff --git a/include/cppunit/Makefile.am b/include/cppunit/Makefile.am index ed45597..9e224a5 100644 --- a/include/cppunit/Makefile.am +++ b/include/cppunit/Makefile.am @@ -8,6 +8,7 @@ libcppunitinclude_HEADERS = \ config-msvc6.h \ config-bcb5.h \ Asserter.h \ + CompilerTestResultOutputter.h \ Exception.h \ NotEqualException.h \ Portability.h \ |
