CppUnit project page FAQ CppUnit home page

CompilerOutputter.h
Go to the documentation of this file.
00001 #ifndef CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
00002 #define CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
00003 
00004 #include <cppunit/Portability.h>
00005 #include <cppunit/Outputter.h>
00006 #include <cppunit/portability/Stream.h>
00007 
00008 #if CPPUNIT_NEED_DLL_DECL
00009 #pragma warning( push )
00010 #pragma warning( disable: 4251 )  // X needs to have dll-interface to be used by clients of class Z
00011 #endif 
00012 
00013 CPPUNIT_NS_BEGIN
00014 
00015 
00016 class Exception;
00017 class SourceLine;
00018 class Test;
00019 class TestFailure;
00020 class TestResultCollector;
00021 
00060 class CPPUNIT_API CompilerOutputter : public Outputter
00061 {
00062 public:
00071   CompilerOutputter( TestResultCollector *result,
00072                      OStream &stream,
00073                      const std::string &locationFormat = CPPUNIT_COMPILER_LOCATION_FORMAT );
00074 
00076   virtual ~CompilerOutputter();
00077 
00101   void setLocationFormat( const std::string &locationFormat );
00102 
00107   static CompilerOutputter *defaultOutputter( TestResultCollector *result,
00108                                               OStream &stream );
00109 
00110   void write();
00111 
00112   void setNoWrap();
00113 
00114   void setWrapColumn( int wrapColumn );
00115 
00116   int wrapColumn() const;
00117 
00118   virtual void printSuccess();
00119   virtual void printFailureReport();
00120   virtual void printFailuresList();
00121   virtual void printStatistics();
00122   virtual void printFailureDetail( TestFailure *failure );
00123   virtual void printFailureLocation( SourceLine sourceLine );
00124   virtual void printFailureType( TestFailure *failure );
00125   virtual void printFailedTestName( TestFailure *failure );
00126   virtual void printFailureMessage( TestFailure *failure );
00127 
00128 private:
00130   CompilerOutputter( const CompilerOutputter &copy );
00131 
00133   void operator =( const CompilerOutputter &copy );
00134 
00135   virtual bool processLocationFormatCommand( char command, 
00136                                              const SourceLine &sourceLine );
00137 
00138   virtual std::string extractBaseName( const std::string &fileName ) const;
00139 
00140 private:
00141   TestResultCollector *m_result;
00142   OStream &m_stream;
00143   std::string m_locationFormat;
00144   int m_wrapColumn;
00145 };
00146 
00147 
00148 CPPUNIT_NS_END
00149 
00150 #if CPPUNIT_NEED_DLL_DECL
00151 #pragma warning( pop )
00152 #endif
00153 
00154 #endif  // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers