00001
#ifndef CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
00002
#define CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H
00003
00004
#include <cppunit/Portability.h>
00005
#include <cppunit/Outputter.h>
00006
#include <iostream>
00007
00008
CPPUNIT_NS_BEGIN
00009
00010
00011
class Exception;
00012
class SourceLine;
00013
class Test;
00014
class TestFailure;
00015
class TestResultCollector;
00016
00055 class CPPUNIT_API CompilerOutputter :
public Outputter
00056 {
00057
public:
00066 CompilerOutputter(
TestResultCollector *result,
00067 std::ostream &stream,
00068
const std::string &locationFormat =
CPPUNIT_COMPILER_LOCATION_FORMAT );
00069
00071
virtual ~CompilerOutputter();
00072
00096
void setLocationFormat(
const std::string &locationFormat );
00097
00102
static CompilerOutputter *defaultOutputter(
TestResultCollector *result,
00103 std::ostream &stream );
00104
00105
void write();
00106
00107
void setNoWrap();
00108
00109
void setWrapColumn(
int wrapColumn );
00110
00111
int wrapColumn()
const;
00112
00113
virtual void printSuccess();
00114
virtual void printFailureReport();
00115
virtual void printFailuresList();
00116
virtual void printStatistics();
00117
virtual void printFailureDetail(
TestFailure *failure );
00118
virtual void printFailureLocation(
SourceLine sourceLine );
00119
virtual void printFailureType(
TestFailure *failure );
00120
virtual void printFailedTestName(
TestFailure *failure );
00121
virtual void printFailureMessage(
TestFailure *failure );
00122
00123
private:
00125 CompilerOutputter(
const CompilerOutputter © );
00126
00128
void operator =(
const CompilerOutputter © );
00129
00130
virtual bool processLocationFormatCommand(
char command,
00131
const SourceLine &sourceLine );
00132
00133
virtual std::string extractBaseName(
const std::string &fileName )
const;
00134
00135
private:
00136 TestResultCollector *m_result;
00137 std::ostream &m_stream;
00138 std::string m_locationFormat;
00139 int m_wrapColumn;
00140 };
00141
00142
00143
CPPUNIT_NS_END
00144
00145
00146
#endif // CPPUNIT_COMPILERTESTRESULTOUTPUTTER_H