summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72080e3)
raw | patch | inline | side by side (parent: 72080e3)
author | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Apr 2006 02:29:29 +0000 (02:29 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Apr 2006 02:29:29 +0000 (02:29 +0000) |
ChangeLog | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/MultiPrinter.h | [new file with mode: 0644] | patch | blob |
src/PylogFormatter.h | [new file with mode: 0644] | patch | blob |
src/TRPIFormatter.h | [new file with mode: 0644] | patch | blob |
src/libnr/Makefile_insert | patch | blob | history | |
src/selfname.tpl | [new file with mode: 0644] | patch | blob |
src/svg/Makefile_insert | patch | blob | history | |
src/xml/Makefile_insert | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 1d436e50508f80ec40d5a4438f6c597af12da11f..40549d43bfa0576f9c1c3ee7f52d20b7bcd2ee14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-04-26 Jon A. Cruz <jon@joncruz.org>
+
+ * src/Makefile.am, src/MultiPrinter.h, src/PylogFormatter.h,
+ src/TRPIFormatter.h, src/selfname.tpl, src/libnr/Makefile_insert,
+ src/svg/Makefile_insert, src/xml/Makefile_insert:
+ Adding multiple test output formats.
+
2006-04-23 verbalshadow <verbalshadow@gmail.com>
* path-prefix.h:
diff --git a/src/Makefile.am b/src/Makefile.am
index 23aa417af003d2ed047ac54aa4e62c223ac8d4e8..b4fd7a56328e8cd70c0514032d2c3ef88155a9a5 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
$(svg_test_svg_includes) \
$(xml_test_xml_includes) \
$(test_all_includes)
- $(top_srcdir)/cxxtest/cxxtestgen.pl --error-printer -root -o test-all.cpp \
+ $(top_srcdir)/cxxtest/cxxtestgen.pl --template=selfname.tpl -root -o test-all.cpp \
$(libnr_test_nr_includes) \
$(svg_test_svg_includes) \
$(xml_test_xml_includes) \
diff --git a/src/MultiPrinter.h b/src/MultiPrinter.h
--- /dev/null
+++ b/src/MultiPrinter.h
@@ -0,0 +1,113 @@
+#ifndef SEEN_MULTI_PRINTER_H
+#define SEEN_MULTI_PRINTER_H
+
+
+#include <cxxtest/Flags.h>
+
+#ifndef _CXXTEST_HAVE_STD
+# define _CXXTEST_HAVE_STD
+#endif // _CXXTEST_HAVE_STD
+
+#include <cxxtest/ErrorFormatter.h>
+#include <cxxtest/StdValueTraits.h>
+
+#ifdef _CXXTEST_OLD_STD
+# include <iostream.h>
+# include <fstream.h>
+# include <string.h>
+#else // !_CXXTEST_OLD_STD
+# include <iostream>
+# include <fstream>
+# include <string>
+#endif // _CXXTEST_OLD_STD
+
+
+#include <cxxtest/TeeListener.h>
+#include "TRPIFormatter.h"
+#include "PylogFormatter.h"
+
+namespace CxxTest {
+
+class MultiPrinter : public TeeListener
+{
+public:
+ MultiPrinter( const char* baseName = "result" ) :
+ TeeListener(),
+ _baseName( baseName ),
+ _xmlName( _baseName + ".xml" ),
+ _logName( _baseName + ".log" ),
+ _xmlFile( _xmlName.c_str(), CXXTEST_STD(ios::out)),
+ _logFile( _logName.c_str(), CXXTEST_STD(ios::out)),
+ _dstOne( new FileAdapter( CXXTEST_STD(cout) ) ),
+ _dstXml( new FileAdapter( _xmlFile ) ),
+ _dstPylog( new FileAdapter( _logFile ), _baseName.c_str() )
+ {
+ setFirst( _dstOne );
+ setSecond( _subTee );
+ _subTee.setFirst( _dstXml );
+ _subTee.setSecond( _dstPylog );
+ }
+
+ virtual ~MultiPrinter()
+ {
+ std::cout << "CLOSING OUT TEST" << std::endl;
+ _xmlFile.close();
+ _logFile.close();
+ }
+
+ int run()
+ {
+ TestRunner::runAllTests( *this );
+ return tracker().failedTests();
+ }
+
+protected:
+ CXXTEST_STD(string) _baseName;
+ CXXTEST_STD(string) _xmlName;
+ CXXTEST_STD(string) _logName;
+ CXXTEST_STD(fstream) _xmlFile;
+ CXXTEST_STD(fstream) _logFile;
+
+ TeeListener _subTee;
+ ErrorFormatter _dstOne;
+ TRPIFormatter _dstXml;
+ PylogFormatter _dstPylog;
+
+private:
+ class FileAdapter : public OutputStream
+ {
+ FileAdapter( const FileAdapter & );
+ FileAdapter &operator=( const FileAdapter & );
+
+ CXXTEST_STD(ostream) &_o;
+
+ public:
+ FileAdapter( CXXTEST_STD(ostream) &o ) : _o(o) {}
+ void flush() { _o.flush(); }
+ OutputStream &operator<<( const char *s ) { _o << s; return *this; }
+ OutputStream &operator<<( Manipulator m ) { return OutputStream::operator<<( m ); }
+ OutputStream &operator<<( unsigned i )
+ {
+ char s[1 + 3 * sizeof(unsigned)];
+ numberToString( i, s );
+ _o << s;
+ return *this;
+ }
+ };
+
+};
+
+}
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+
+#endif //SEEN_MULTI_PRINTER_H
diff --git a/src/PylogFormatter.h b/src/PylogFormatter.h
--- /dev/null
+++ b/src/PylogFormatter.h
@@ -0,0 +1,384 @@
+#ifndef PYLOG_FORMATTER_H_SEEN
+#define PYLOG_FORMATTER_H_SEEN
+
+#include <cxxtest/Flags.h>
+
+#ifndef _CXXTEST_HAVE_STD
+# define _CXXTEST_HAVE_STD
+#endif // _CXXTEST_HAVE_STD
+
+#include <cxxtest/ErrorFormatter.h>
+#include <cxxtest/StdValueTraits.h>
+
+#ifdef _CXXTEST_OLD_STD
+# include <iostream.h>
+#else // !_CXXTEST_OLD_STD
+# include <iostream>
+#endif // _CXXTEST_OLD_STD
+
+namespace CxxTest
+{
+class PylogFormatter : public TestListener
+{
+public:
+ PylogFormatter( OutputStream *o, const char* name = "test" ) :
+ _o(o),
+ _base( _chompPath( name ) ),
+ _runPassed(true),
+ _suiteIndex(-1),
+ _testIndex(-1)
+ {}
+ virtual ~PylogFormatter() { delete outputStream(); }
+
+ virtual void enterWorld( const WorldDescription & desc )
+ {
+ (*_o) << "**************************************************" << endl;
+ _o->flush();
+ }
+
+ virtual void leaveWorld( const WorldDescription & desc )
+ {
+ unsigned int skippedCount = 0;
+ unsigned int failedCount = 0;
+ unsigned int warnedCount = 0;
+ unsigned int passedCount = 0;
+
+ for ( unsigned int i = 0; i < desc.numSuites(); i++ ) {
+ const SuiteDescription& suite = desc.suiteDescription(i);
+ for ( unsigned int j = 0; j < suite.numTests(); j++ ) {
+ const TestDescription& test = suite.testDescription(j);
+
+ // Test Name
+ (*_o) << _base.c_str() << "_";
+ _padOut( i, 3 );
+ (*_o) << "_";
+ _padOut( j, 3);
+ (*_o) << " ";
+
+ // Test Description
+ (*_o) << test.suiteName() << "_|_" << test.testName();
+ (*_o) << " ";
+
+ int sent = strlen( test.suiteName() ) + strlen( test.testName() ) + 1;
+ for ( int z = sent; z < 56; z++ ) {
+ (*_o) << " ";
+ }
+
+ (*_o) << " : ";
+
+ switch ( _status[i][j] ) {
+ case OK:
+ (*_o) << "PASS";
+ passedCount++;
+ break;
+ case SKIPPED:
+ (*_o) << "OMIT";
+ skippedCount++;
+ break;
+ case WARNING:
+ (*_o) << "WARNING";
+ warnedCount++;
+ break;
+ case ERROR:
+ (*_o) << "FAILURE";
+ failedCount++;
+ break;
+ }
+
+ (*_o) << endl;
+ for ( CXXTEST_STD(vector)<CXXTEST_STD(string)>::iterator it = _messages[i][j].begin(); it < _messages[i][j].end(); ++it ) {
+ (*_o) << " " << (*it).c_str() << endl;
+ }
+ }
+ }
+
+ (*_o) << "**************************************************" << endl;
+ (*_o) << "Command line asked for " << desc.numTotalTests() << " of " << desc.numTotalTests() << " tests" << endl;
+ (*_o) << "Of those: "
+ << skippedCount << " Skipped, "
+ << failedCount << " Failed, "
+ << warnedCount << " Warned, "
+ << passedCount << " Passed"
+ << endl;
+ }
+
+
+ virtual void enterSuite( const SuiteDescription & desc )
+ {
+ (void)desc;
+ _suiteIndex++;
+ _testIndex = -1;
+ while ( (_suiteIndex >= 0) && ((int)_status.size() <= _suiteIndex) ) {
+ CXXTEST_STD(vector)<ErrorLevel> tmp;
+ _status.push_back(tmp);
+ CXXTEST_STD(vector)<CXXTEST_STD(vector)<CXXTEST_STD(string)> > tmp2;
+ _messages.push_back(tmp2);
+ }
+ }
+
+ virtual void leaveSuite( const SuiteDescription & desc )
+ {
+ (void)desc;
+ }
+
+ virtual void enterTest( const TestDescription & desc )
+ {
+ (void)desc;
+ if ( _suiteIndex >= 0 && (int)_status.size() > _suiteIndex ) {
+ _testIndex++;
+ while ( (_testIndex >= 0) && ((int)_status[_suiteIndex].size() <= _testIndex) ) {
+ ErrorLevel tmp = OK;
+ _status[_suiteIndex].push_back(tmp);
+ CXXTEST_STD(vector)<CXXTEST_STD(string)> tmp2;
+ _messages[_suiteIndex].push_back(tmp2);
+ }
+ }
+ }
+
+ virtual void leaveTest( const TestDescription & desc )
+ {
+ (void)desc;
+ }
+
+ virtual void trace( const char * file, unsigned line,
+ const char * expression )
+ {
+ CXXTEST_STD(string)tmp(expression);
+ _traceCurrent( file, line, tmp );
+ }
+
+ virtual void warning( const char * file, unsigned line,
+ const char * expression )
+ {
+ CXXTEST_STD(string)tmp(expression);
+ _warnCurrent( file, line, tmp );
+ }
+
+ virtual void failedTest( const char * file, unsigned line,
+ const char * expression )
+ {
+ CXXTEST_STD(string)tmp(expression);
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssert( const char * file, unsigned line,
+ const char * expression )
+ {
+ CXXTEST_STD(string)tmp(expression);
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertEquals( const char * file, unsigned line,
+ const char * xStr, const char * yStr,
+ const char * x, const char * y )
+ {
+ CXXTEST_STD(string)tmp;
+ tmp += "Expected (";
+ tmp += xStr;
+ tmp += " == ";
+ tmp += yStr;
+ tmp += "), found (";
+ tmp += x;
+ tmp += " != ";
+ tmp += y;
+ tmp += ")";
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertSameData( const char * file, unsigned line,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*sizeStr*/, const void * /*x*/,
+ const void * /*y*/, unsigned /*size*/ )
+ {
+ CXXTEST_STD(string)tmp("TODO - fill in error details");
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertDelta( const char * file, unsigned line,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*dStr*/, const char * /*x*/,
+ const char * /*y*/, const char * /*d*/ )
+ {
+ CXXTEST_STD(string)tmp("TODO - fill in error details");
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertDiffers( const char * file, unsigned line,
+ const char * xStr, const char * yStr,
+ const char * value )
+ {
+ CXXTEST_STD(string)tmp;
+ tmp += "Expected (";
+ tmp += xStr;
+ tmp += " != ";
+ tmp += yStr;
+ tmp += "), found (";
+ tmp += value;
+ tmp += ")";
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertLessThan( const char * file, unsigned line,
+ const char * xStr, const char * yStr,
+ const char * x, const char * y )
+ {
+ CXXTEST_STD(string)tmp;
+ tmp += "Expected (";
+ tmp += xStr;
+ tmp += " < ";
+ tmp += yStr;
+ tmp += "), found (";
+ tmp += x;
+ tmp += " >= ";
+ tmp += y;
+ tmp += ")";
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertLessThanEquals( const char * file, unsigned line,
+ const char * xStr, const char * yStr,
+ const char * x, const char * y )
+ {
+ CXXTEST_STD(string)tmp;
+ tmp += "Expected (";
+ tmp += xStr;
+ tmp += " <= ";
+ tmp += yStr;
+ tmp += "), found (";
+ tmp += x;
+ tmp += " > ";
+ tmp += y;
+ tmp += ")";
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertPredicate( const char * file, unsigned line,
+ const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/ )
+ {
+ CXXTEST_STD(string)tmp("TODO - fill in error details");
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertRelation( const char * file, unsigned line,
+ const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ )
+ {
+ CXXTEST_STD(string)tmp("TODO - fill in error details");
+ _failCurrent( file, line, tmp);
+ }
+
+ virtual void failedAssertThrows( const char * file, unsigned line,
+ const char * /*expression*/, const char * /*type*/,
+ bool /*otherThrown*/ )
+ {
+ CXXTEST_STD(string)tmp("TODO - fill in error details");
+ _failCurrent( file, line, tmp );
+ }
+
+ virtual void failedAssertThrowsNot( const char * file, unsigned line,
+ const char * expression )
+ {
+ CXXTEST_STD(string)tmp(expression);
+ _failCurrent( file, line, tmp );
+ }
+
+protected:
+
+ enum ErrorLevel {
+ OK,
+ SKIPPED,
+ WARNING,
+ ERROR
+ };
+
+ OutputStream *outputStream() const
+ {
+ return _o;
+ }
+
+ void _traceCurrent( const char* file, unsigned line, const CXXTEST_STD(string)& errMsg ) {
+ _runPassed = false;
+ if ( _suiteIndex < (int)_status.size() ) {
+ if ( _testIndex < (int)_status[_suiteIndex].size() ) {
+ _messages[_suiteIndex][_testIndex].push_back( errMsg );
+ }
+ }
+ }
+
+ void _warnCurrent( const char* file, unsigned line, const CXXTEST_STD(string)& errMsg ) {
+ _runPassed = false;
+ if ( _suiteIndex < (int)_status.size() ) {
+ if ( _testIndex < (int)_status[_suiteIndex].size() ) {
+ if ( _status[_suiteIndex][_testIndex] != ERROR ) {
+ _status[_suiteIndex][_testIndex] = WARNING;
+ }
+
+ _messages[_suiteIndex][_testIndex].push_back( errMsg );
+ }
+ }
+ }
+
+ void _failCurrent( const char* file, unsigned line, const CXXTEST_STD(string)& errMsg ) {
+ _runPassed = false;
+ if ( _suiteIndex < (int)_status.size() ) {
+ if ( _testIndex < (int)_status[_suiteIndex].size() ) {
+ _status[_suiteIndex][_testIndex] = ERROR;
+
+ _messages[_suiteIndex][_testIndex].push_back( errMsg );
+ }
+ }
+ }
+
+ void _padOut( unsigned int num, int digits )
+ {
+ int match = 1;
+ for ( int j = 1; j < digits; j++ ) {
+ match *= 10;
+ }
+
+ for ( unsigned int i = match; i > 1 && i > num; i /= 10 )
+ {
+ (*_o) << "0";
+ }
+ (*_o) << num;
+ }
+
+private:
+ static void endl( OutputStream &o )
+ {
+ OutputStream::endl( o );
+ }
+
+ static CXXTEST_STD(string) _chompPath( const char* str )
+ {
+ CXXTEST_STD(string) tmp( str );
+ if ( tmp.length() > 2 && tmp[0] == '.' && tmp[1] == '/' ) {
+ tmp = tmp.substr( 2 );
+ }
+ return tmp;
+ }
+
+ OutputStream *_o;
+ CXXTEST_STD(string) _base;
+ CXXTEST_STD(vector)< CXXTEST_STD(vector)<ErrorLevel> > _status;
+ CXXTEST_STD(vector)< CXXTEST_STD(vector)< CXXTEST_STD(vector)<CXXTEST_STD(string)> > > _messages;
+
+ bool _runPassed;
+ int _suiteIndex;
+ int _testIndex;
+};
+
+} // namespace CxxTest
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+
+#endif // PYLOG_FORMATTER_H_SEEN
diff --git a/src/TRPIFormatter.h b/src/TRPIFormatter.h
--- /dev/null
+++ b/src/TRPIFormatter.h
@@ -0,0 +1,194 @@
+#ifndef TRPI_FORMATTER_H_SEEN
+#define TRPI_FORMATTER_H_SEEN
+
+#include <cxxtest/Flags.h>
+
+#ifndef _CXXTEST_HAVE_STD
+# define _CXXTEST_HAVE_STD
+#endif // _CXXTEST_HAVE_STD
+
+#include <cxxtest/ErrorFormatter.h>
+#include <cxxtest/StdValueTraits.h>
+
+#ifdef _CXXTEST_OLD_STD
+# include <iostream.h>
+#else // !_CXXTEST_OLD_STD
+# include <iostream>
+#endif // _CXXTEST_OLD_STD
+
+namespace CxxTest
+{
+class TRPIFormatter : public TestListener
+{
+public:
+ TRPIFormatter( OutputStream *o ) :
+ _o(o),
+ _runPassed(true),
+ _suiteIndex(-1),
+ _testIndex(-1)
+ {}
+ virtual ~TRPIFormatter() { delete outputStream(); }
+
+ virtual void enterWorld( const WorldDescription & desc )
+ {
+ _status.clear();
+
+ (*_o) << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" << endl;
+ (*_o) << "<component name=\"inkscape\" version=\"0.43+svn\" xmlns=\"http://www.spikesource.com/xsd/2005/04/TRPI\">" << endl;
+ (*_o) << " <description>TBD</description>" << endl;
+ (*_o) << " <summary>single-line info</summary>" << endl;
+ (*_o) << " <license></license>" << endl;
+ (*_o) << " <vendor></vendor>" << endl;
+ (*_o) << " <release>devel SVN</release>" << endl;
+ (*_o) << " <url>http://www.inkscape.org/</url>" << endl;
+// (*_o) << " <root></root>" << endl;
+ (*_o) << " <platform>\?\?\?</platform>" << endl;
+ _o->flush();
+ }
+
+ virtual void leaveWorld( const WorldDescription & desc )
+ {
+ (*_o) << " <build status=\"" << (_runPassed?"pass":"fail") << "\"/>" << endl;
+
+ for ( unsigned int i = 0; i < desc.numSuites(); i++ ) {
+ const SuiteDescription& suite = desc.suiteDescription(i);
+ for ( unsigned int j = 0; j < suite.numTests(); j++ ) {
+ const TestDescription& test = suite.testDescription(j);
+ (*_o) << " <test suite-type=\"unit\">" << endl;
+ (*_o) << " <result executed=\"" << (unsigned)1
+ << "\" passed=\"" << (unsigned)(_status[i][j] ? 1:0)
+ << "\" failed=\"" << (unsigned)(_status[i][j] ? 0:1)
+ << "\" skipped=\"" << (unsigned)0
+ << "\"/>" << endl;
+
+ (*_o) << " <suiteName>" << test.suiteName() << "</suiteName>" << endl;
+ (*_o) << " <testName>" << test.testName() << "</testName>" << endl;
+
+// (*_o) << " <report name=\"" << test.suiteName() << "|" << test.testName() << "\" path=\"index.html\"/>" << endl;
+
+ (*_o) << " <expected-result executed=\"" << (unsigned)1
+ << "\" passed=\"" << (unsigned)1
+ << "\" failed=\"" << (unsigned)0
+ << "\" skipped=\"" << (unsigned)0
+ << "\"/>" << endl;
+ (*_o) << " </test>" << endl;
+ }
+ }
+
+// (*_o) << " <coverage-report />" << endl;
+// (*_o) << " <code-convention-report />" << endl;
+ (*_o) << "</component>" << endl;
+ }
+
+ virtual void enterSuite( const SuiteDescription & desc )
+ {
+ (void)desc;
+ _suiteIndex++;
+ _testIndex = -1;
+ while ( (_suiteIndex >= 0) && ((int)_status.size() <= _suiteIndex) ) {
+ std::vector<bool> tmp;
+ _status.push_back(tmp);
+ }
+ }
+
+ virtual void leaveSuite( const SuiteDescription & desc )
+ {
+ (void)desc;
+ }
+
+ virtual void enterTest( const TestDescription & desc )
+ {
+ (void)desc;
+ if ( _suiteIndex >= 0 && (int)_status.size() > _suiteIndex ) {
+ _testIndex++;
+ while ( (_testIndex >= 0) && ((int)_status[_suiteIndex].size() <= _testIndex) ) {
+ bool tmp = true;
+ _status[_suiteIndex].push_back(tmp);
+ }
+ }
+ }
+
+ virtual void leaveTest( const TestDescription & desc )
+ {
+ (void)desc;
+ }
+
+
+
+ virtual void failedTest( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/ ) { _failCurrent(); }
+ virtual void failedAssert( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/ ) { _failCurrent(); }
+ virtual void failedAssertEquals( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ ) { _failCurrent(); }
+ virtual void failedAssertSameData( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*sizeStr*/, const void * /*x*/,
+ const void * /*y*/, unsigned /*size*/ ) { _failCurrent(); }
+ virtual void failedAssertDelta( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*dStr*/, const char * /*x*/,
+ const char * /*y*/, const char * /*d*/ ) { _failCurrent(); }
+ virtual void failedAssertDiffers( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*value*/ ) { _failCurrent(); }
+ virtual void failedAssertLessThan( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ ) { _failCurrent(); }
+ virtual void failedAssertLessThanEquals( const char * /*file*/, unsigned /*line*/,
+ const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ ) { _failCurrent(); }
+ virtual void failedAssertPredicate( const char * /*file*/, unsigned /*line*/,
+ const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/ ) { _failCurrent(); }
+ virtual void failedAssertRelation( const char * /*file*/, unsigned /*line*/,
+ const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/,
+ const char * /*x*/, const char * /*y*/ ) { _failCurrent(); }
+ virtual void failedAssertThrows( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/, const char * /*type*/,
+ bool /*otherThrown*/ ) { _failCurrent(); }
+ virtual void failedAssertThrowsNot( const char * /*file*/, unsigned /*line*/,
+ const char * /*expression*/ ) { _failCurrent(); }
+
+protected:
+ OutputStream *outputStream() const
+ {
+ return _o;
+ }
+
+ void _failCurrent() {
+ _runPassed = false;
+ if ( _suiteIndex < (int)_status.size() ) {
+ if ( _testIndex < (int)_status[_suiteIndex].size() ) {
+ _status[_suiteIndex][_testIndex] = false;
+ }
+ }
+ }
+
+private:
+ static void endl( OutputStream &o )
+ {
+ OutputStream::endl( o );
+ }
+
+ OutputStream *_o;
+ std::vector< std::vector<bool> > _status;
+ bool _runPassed;
+ int _suiteIndex;
+ int _testIndex;
+};
+
+} // namespace CxxTest
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+
+#endif // TRPI_FORMATTER_H_SEEN
index 541432193a7826a76bd86be36701fd89eee927d8..004a221be1f2f2437ea0bdc37995031b0235d9cd 100644 (file)
libnr/test-nr-main.cpp: libnr/test-nr.cpp
- $(top_srcdir)/cxxtest/cxxtestgen.pl --error-printer -root -o libnr/test-nr-main.cpp $(libnr_test_nr_includes)
+ $(top_srcdir)/cxxtest/cxxtestgen.pl --template=selfname.tpl -root -o libnr/test-nr-main.cpp $(libnr_test_nr_includes)
libnr/test-nr.cpp: $(libnr_test_nr_includes)
$(top_srcdir)/cxxtest/cxxtestgen.pl -part -o libnr/test-nr.cpp $(libnr_test_nr_includes)
diff --git a/src/selfname.tpl b/src/selfname.tpl
--- /dev/null
+++ b/src/selfname.tpl
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+
+#include "MultiPrinter.h"
+
+int main( int argc, char *argv[] )
+{
+ (void)argc;
+ return CxxTest::MultiPrinter( argv[0] ).run();
+}
+
+// The CxxTest "world"
+<CxxTest world>
index ee3ee25188678edf4d521e76568a56786ab67fae..a1e5963ec9f50c4850537b952b1bec2d00d82169 100644 (file)
--- a/src/svg/Makefile_insert
+++ b/src/svg/Makefile_insert
# This CxxTest stuff is adapted blindly from libnr/Makefile_insert.
# It would be nice to reduce the amount of boilerplate / copy&paste here.
svg/test-svg-main.cpp: svg/test-svg.cpp
- $(top_srcdir)/cxxtest/cxxtestgen.pl --error-printer -root -o svg/test-svg-main.cpp $(svg_test_svg_includes)
+ $(top_srcdir)/cxxtest/cxxtestgen.pl --template=selfname.tpl -root -o svg/test-svg-main.cpp $(svg_test_svg_includes)
svg/test-svg.cpp: $(svg_test_svg_includes) svg/Makefile_insert
$(top_srcdir)/cxxtest/cxxtestgen.pl -part -o svg/test-svg.cpp $(svg_test_svg_includes)
index a678ca25c893e5f75fdbfa8173465bc5b0a91581..7460d89deb7d05d5caa8574b3ad15f7de655dde0 100644 (file)
--- a/src/xml/Makefile_insert
+++ b/src/xml/Makefile_insert
xml/invalid-operation-exception.h
xml/test-xml-main.cpp: xml/test-xml.cpp $(xml_test_xml_includes)
- $(top_srcdir)/cxxtest/cxxtestgen.pl --error-printer -root -o xml/test-xml-main.cpp $(xml_test_xml_includes)
+ $(top_srcdir)/cxxtest/cxxtestgen.pl --template=selfname.tpl -root -o xml/test-xml-main.cpp $(xml_test_xml_includes)
xml/test-xml.cpp: $(xml_test_xml_includes)
$(top_srcdir)/cxxtest/cxxtestgen.pl -part -o xml/test-xml.cpp $(xml_test_xml_includes)