1
// //////////////////////////////////////////////////////////////////////////
2
// Header file ClockerModel.h for class ClockerModel
3
// (c)Copyright 2000, Baptiste Lepilleur.
5
// //////////////////////////////////////////////////////////////////////////
9
#include <cppunit/TestPath.h>
10
#include <cppunit/portability/CppUnitVector.h>
11
#include <cppunit/portability/CppUnitMap.h>
12
#include <cppunit/portability/CppUnitStack.h>
15
#ifdef CLOCKER_USE_WINNTTIMER
16
#include "WinNtTimer.h"
17
typedef WinNtTimer Timer;
23
/// Model that represents test timing.
27
/*! Constructs a ClockerModel object.
32
virtual ~ClockerModel();
34
void setExpectedTestCount( int count );
36
void enterTest( CPPUNIT_NS::Test *test,
39
void exitTest( CPPUNIT_NS::Test *test,
42
double totalElapsedTime() const;
44
double averageTestCaseTime() const;
46
double testTimeFor( CPPUNIT_NS::Test *test ) const;
48
double testTimeFor( int testIndex ) const;
50
static std::string timeStringFor( double time );
52
bool isSuite( int testIndex ) const;
54
const CPPUNIT_NS::TestPath &testPathFor( int testIndex ) const;
57
int indexOf( CPPUNIT_NS::Test *test ) const;
59
int childCountFor( int testIndex ) const;
61
int childAtFor( int testIndex,
62
int chidIndex ) const;
67
CPPUNIT_NS::TestPath m_path;
70
CppUnitVector<int> m_childIndexes;
73
/// Prevents the use of the copy constructor.
74
ClockerModel( const ClockerModel &other );
76
/// Prevents the use of the copy operator.
77
void operator =( const ClockerModel &other );
80
CPPUNIT_NS::TestPath m_currentPath;
83
double m_totalTestCaseTime;
85
typedef CppUnitMap<CPPUNIT_NS::Test *, int> TestToIndexes;
87
TestToIndexes m_testToIndexes;
88
CppUnitStack<int> m_testIndexes;
89
CppUnitVector<TestInfo> m_tests;
95
#endif // CLOCKERMODEL_H