|
Packit |
8c9aa0 |
// //////////////////////////////////////////////////////////////////////////
|
|
Packit |
8c9aa0 |
// Header file ClockerListener.h for class ClockerListener
|
|
Packit |
8c9aa0 |
// (c)Copyright 2000, Baptiste Lepilleur.
|
|
Packit |
8c9aa0 |
// Created: 2002/04/19
|
|
Packit |
8c9aa0 |
// //////////////////////////////////////////////////////////////////////////
|
|
Packit |
8c9aa0 |
#ifndef CLOCKERLISTENER_H
|
|
Packit |
8c9aa0 |
#define CLOCKERLISTENER_H
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
#include <cppunit/TestListener.h>
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
class ClockerModel;
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
/// TestListener that prints a flatten or hierarchical view of the test tree.
|
|
Packit |
8c9aa0 |
class ClockerListener : public CPPUNIT_NS::TestListener
|
|
Packit |
8c9aa0 |
{
|
|
Packit |
8c9aa0 |
public:
|
|
Packit |
8c9aa0 |
ClockerListener( ClockerModel *model,
|
|
Packit |
8c9aa0 |
bool text );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
virtual ~ClockerListener();
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void startTestRun( CPPUNIT_NS::Test *test,
|
|
Packit |
8c9aa0 |
CPPUNIT_NS::TestResult *eventManager );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void endTestRun( CPPUNIT_NS::Test *test,
|
|
Packit |
8c9aa0 |
CPPUNIT_NS::TestResult *eventManager );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void startTest( CPPUNIT_NS::Test *test );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void endTest( CPPUNIT_NS::Test *test );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void startSuite( CPPUNIT_NS::Test *suite );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void endSuite( CPPUNIT_NS::Test *suite );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
private:
|
|
Packit |
8c9aa0 |
void printStatistics() const;
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void printTest( int testIndex,
|
|
Packit |
8c9aa0 |
const std::string &indentString ) const;
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void printTestIndent( const std::string &indent,
|
|
Packit |
8c9aa0 |
const int indentLength ) const;
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
void printTime( double time ) const;
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
/// Prevents the use of the copy constructor.
|
|
Packit |
8c9aa0 |
ClockerListener( const ClockerListener &other );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
/// Prevents the use of the copy operator.
|
|
Packit |
8c9aa0 |
void operator =( const ClockerListener &other );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
private:
|
|
Packit |
8c9aa0 |
ClockerModel *m_model;
|
|
Packit |
8c9aa0 |
bool m_text;
|
|
Packit |
8c9aa0 |
};
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
// Inlines methods for ClockerListener:
|
|
Packit |
8c9aa0 |
// -----------------------------------
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
#endif // CLOCKERLISTENER_H
|