70fd8f7de4994668eeb9f532d0523266a176e795joncruz#endif // _CXXTEST_HAVE_STD
70fd8f7de4994668eeb9f532d0523266a176e795joncruz#else // !_CXXTEST_OLD_STD
70fd8f7de4994668eeb9f532d0523266a176e795joncruz#endif // _CXXTEST_OLD_STD
70fd8f7de4994668eeb9f532d0523266a176e795joncruz PylogFormatter( OutputStream *o, const char* name = "test" ) :
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual ~PylogFormatter() { delete outputStream(); }
6ad76e4c8e1862d23d04bb34a3fbc330e6b8cd30joncruz virtual void enterWorld( const WorldDescription & /*desc*/ )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz (*_o) << "**************************************************" << endl;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void leaveWorld( const WorldDescription & desc )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz for ( unsigned int i = 0; i < desc.numSuites(); i++ ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const SuiteDescription& suite = desc.suiteDescription(i);
70fd8f7de4994668eeb9f532d0523266a176e795joncruz for ( unsigned int j = 0; j < suite.numTests(); j++ ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const TestDescription& test = suite.testDescription(j);
70fd8f7de4994668eeb9f532d0523266a176e795joncruz // Test Name
70fd8f7de4994668eeb9f532d0523266a176e795joncruz // Test Description
70fd8f7de4994668eeb9f532d0523266a176e795joncruz (*_o) << test.suiteName() << "_|_" << test.testName();
69340304f32eac4d438c67b5e1f6bc2f0a05ea22pjrm unsigned const sent = strlen( test.suiteName() ) + strlen( test.testName() ) + 1;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz switch ( _status[i][j] ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz for ( CXXTEST_STD(vector)<CXXTEST_STD(string)>::iterator it = _messages[i][j].begin(); it < _messages[i][j].end(); ++it ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz (*_o) << "**************************************************" << endl;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz (*_o) << "Command line asked for " << desc.numTotalTests() << " of " << desc.numTotalTests() << " tests" << endl;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void enterSuite( const SuiteDescription & desc )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz while ( (_suiteIndex >= 0) && ((int)_status.size() <= _suiteIndex) ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(vector)<CXXTEST_STD(vector)<CXXTEST_STD(string)> > tmp2;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void leaveSuite( const SuiteDescription & desc )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void enterTest( const TestDescription & desc )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz if ( _suiteIndex >= 0 && (int)_status.size() > _suiteIndex ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz while ( (_testIndex >= 0) && ((int)_status[_suiteIndex].size() <= _testIndex) ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void leaveTest( const TestDescription & desc )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void trace( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * expression )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void warning( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * expression )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedTest( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * expression )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssert( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * expression )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertEquals( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * x, const char * y )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertSameData( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(string)tmp("TODO - fill in error details");
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertDelta( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(string)tmp("TODO - fill in error details");
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertDiffers( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * value )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertLessThan( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * x, const char * y )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertLessThanEquals( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * x, const char * y )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertPredicate( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/ )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(string)tmp("TODO - fill in error details");
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertRelation( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(string)tmp("TODO - fill in error details");
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertThrows( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz bool /*otherThrown*/ )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(string)tmp("TODO - fill in error details");
70fd8f7de4994668eeb9f532d0523266a176e795joncruz virtual void failedAssertThrowsNot( const char * file, unsigned line,
70fd8f7de4994668eeb9f532d0523266a176e795joncruz const char * expression )
6ad76e4c8e1862d23d04bb34a3fbc330e6b8cd30joncruz void _traceCurrent( const char* /*file*/, unsigned /*line*/, const CXXTEST_STD(string)& errMsg ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz if ( _testIndex < (int)_status[_suiteIndex].size() ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz _messages[_suiteIndex][_testIndex].push_back( errMsg );
6ad76e4c8e1862d23d04bb34a3fbc330e6b8cd30joncruz void _warnCurrent( const char* /*file*/, unsigned /*line*/, const CXXTEST_STD(string)& errMsg ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz if ( _testIndex < (int)_status[_suiteIndex].size() ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz _messages[_suiteIndex][_testIndex].push_back( errMsg );
6ad76e4c8e1862d23d04bb34a3fbc330e6b8cd30joncruz void _failCurrent( const char* /*file*/, unsigned /*line*/, const CXXTEST_STD(string)& errMsg ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz if ( _testIndex < (int)_status[_suiteIndex].size() ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz _messages[_suiteIndex][_testIndex].push_back( errMsg );
70fd8f7de4994668eeb9f532d0523266a176e795joncruz for ( unsigned int i = match; i > 1 && i > num; i /= 10 )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz static CXXTEST_STD(string) _chompPath( const char* str )
70fd8f7de4994668eeb9f532d0523266a176e795joncruz if ( tmp.length() > 2 && tmp[0] == '.' && tmp[1] == '/' ) {
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(vector)< CXXTEST_STD(vector)<ErrorLevel> > _status;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz CXXTEST_STD(vector)< CXXTEST_STD(vector)< CXXTEST_STD(vector)<CXXTEST_STD(string)> > > _messages;
70fd8f7de4994668eeb9f532d0523266a176e795joncruz} // namespace CxxTest
70fd8f7de4994668eeb9f532d0523266a176e795joncruz Local Variables:
70fd8f7de4994668eeb9f532d0523266a176e795joncruz c-file-style:"stroustrup"
70fd8f7de4994668eeb9f532d0523266a176e795joncruz c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70fd8f7de4994668eeb9f532d0523266a176e795joncruz indent-tabs-mode:nil
70fd8f7de4994668eeb9f532d0523266a176e795joncruz fill-column:99
a4030d5ca449e7e384bc699cd249ee704faaeab0Chris Morgan// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
70fd8f7de4994668eeb9f532d0523266a176e795joncruz#endif // PYLOG_FORMATTER_H_SEEN