diff options
Diffstat (limited to 'include/cppunit/CompilerOutputter.h')
| -rw-r--r-- | include/cppunit/CompilerOutputter.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/include/cppunit/CompilerOutputter.h b/include/cppunit/CompilerOutputter.h new file mode 100644 index 0000000..9f4840b --- /dev/null +++ b/include/cppunit/CompilerOutputter.h @@ -0,0 +1,65 @@ +#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 CompilerOutputter + * \brief This class implements output test result in a compiler compatible format. + */ +class CompilerOutputter +{ +public: + /*! Constructs a CompilerOutputter object. + */ + CompilerOutputter( TestResult *result, + std::ostream &stream ); + + /// Destructor. + virtual ~CompilerOutputter(); + + static CompilerOutputter *defaultOutputter( TestResult *result, + std::ostream &stream ); + + 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. + CompilerOutputter( const CompilerOutputter © ); + + /// Prevents the use of the copy operator. + void operator =( const CompilerOutputter © ); + +private: + TestResult *m_result; + std::ostream &m_stream; +}; + + +} // namespace CppUnit + + + +#endif // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H |
