Loading...
Searching...
No Matches
CxxTest::TestTracker Class Reference

`#include <TestTracker.h>`

## Public Member Functions

virtual | ~TestTracker ()
const TestDescription * | fixTest (const TestDescription *d) const
const SuiteDescription * | fixSuite (const SuiteDescription *d) const
const WorldDescription * | fixWorld (const WorldDescription *d) const
const TestDescription & | test () const
const SuiteDescription & | suite () const
const WorldDescription & | world () const
bool | testFailed () const
bool | suiteFailed () const
bool | worldFailed () const
unsigned | warnings () const
unsigned | failedTests () const
unsigned | testFailedAsserts () const
unsigned | suiteFailedTests () const
unsigned | failedSuites () const
void | enterWorld (const WorldDescription &wd)
void | enterSuite (const SuiteDescription &sd)
void | enterTest (const TestDescription &td)
void | leaveTest (const TestDescription &td)
void | leaveSuite (const SuiteDescription &sd)
void | leaveWorld (const WorldDescription &wd)
void | trace (const char *file, unsigned line, const char *expression)
void | warning (const char *file, unsigned line, const char *expression)
void | failedTest (const char *file, unsigned line, const char *expression)
void | failedAssert (const char *file, unsigned line, const char *expression)
void | failedAssertEquals (const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
void | failedAssertSameData (const char *file, unsigned line, const char *xStr, const char *yStr, const char *sizeStr, const void *x, const void *y, unsigned size)
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)
void | failedAssertDiffers (const char *file, unsigned line, const char *xStr, const char *yStr, const char *value)
void | failedAssertLessThan (const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
void | failedAssertLessThanEquals (const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
void | failedAssertPredicate (const char *file, unsigned line, const char *predicate, const char *xStr, const char *x)
void | failedAssertRelation (const char *file, unsigned line, const char *relation, const char *xStr, const char *yStr, const char *x, const char *y)
void | failedAssertThrows (const char *file, unsigned line, const char *expression, const char *type, bool otherThrown)
void | failedAssertThrowsNot (const char *file, unsigned line, const char *expression)
Public Member Functions inherited from CxxTest::TestListener
| TestListener ()
virtual | ~TestListener ()

## Static Public Member Functions

static TestTracker & | tracker ()

## Private Member Functions

| TestTracker (const TestTracker &)
TestTracker & | operator= (const TestTracker &)
const TestDescription & | dummyTest () const
const SuiteDescription & | dummySuite () const
const WorldDescription & | dummyWorld () const
void | setWorld (const WorldDescription *w)
void | setSuite (const SuiteDescription *s)
void | setTest (const TestDescription *t)
void | countWarning ()
void | countFailure ()
| TestTracker ()
void | initialize ()
void | setListener (TestListener *l)

## Private Attributes

STATIC_VAR bool | _created = false
TestListener | _dummyListener
DummyWorldDescription | _dummyWorld
unsigned | _warnings
unsigned | _failedTests
unsigned | _testFailedAsserts
unsigned | _suiteFailedTests
unsigned | _failedSuites
TestListener * | _l
const WorldDescription * | _world
const SuiteDescription * | _suite
const TestDescription * | _test

## Friends

class | TestRunner

## Detailed Description

Definition at line 17 of file TestTracker.h.

## Constructor & Destructor Documentation

## ~TestTracker()

CxxTest::TestTracker::~TestTracker | ( |  | ) |

virtual

Definition at line 18 of file TestTracker.cpp.

{
}

## TestTracker() [1/2]

CxxTest::TestTracker::TestTracker | ( | const TestTracker & |  | ) |

private

## TestTracker() [2/2]

CxxTest::TestTracker::TestTracker | ( |  | ) |

private

Definition at line 10 of file TestTracker.cpp.

{
if ( !_created ) {
initialize();
_created = true;
}
}
CxxTest::TestTracker::_created
STATIC_VAR bool _created
Definition TestTracker.h:85
CxxTest::TestTracker::initialize
void initialize()
Definition TestTracker.cpp:28

## Member Function Documentation

## countFailure()

void CxxTest::TestTracker::countFailure | ( |  | ) |

private

Definition at line 238 of file TestTracker.cpp.

{
if ( ++ _testFailedAsserts == 1 ) {
++ _failedTests;
if ( ++ _suiteFailedTests == 1 )
++ _failedSuites;
}
}
CxxTest::TestTracker::_failedTests
unsigned _failedTests
Definition TestTracker.h:88
CxxTest::TestTracker::_testFailedAsserts
unsigned _testFailedAsserts
Definition TestTracker.h:88
CxxTest::TestTracker::_failedSuites
unsigned _failedSuites
Definition TestTracker.h:88
CxxTest::TestTracker::_suiteFailedTests
unsigned _suiteFailedTests
Definition TestTracker.h:88

## countWarning()

void CxxTest::TestTracker::countWarning | ( |  | ) |

private

Definition at line 233 of file TestTracker.cpp.

{
++ _warnings;
}
CxxTest::TestTracker::_warnings
unsigned _warnings
Definition TestTracker.h:88

## dummySuite()

const SuiteDescription & CxxTest::TestTracker::dummySuite | ( |  | ) | const

private

Definition at line 61 of file TestTracker.cpp.

{
return dummyWorld().suiteDescription(0);
}
CxxTest::TestTracker::dummyWorld
const WorldDescription & dummyWorld() const
Definition TestTracker.cpp:66
CxxTest::WorldDescription::suiteDescription
virtual const SuiteDescription & suiteDescription(unsigned) const =0

## dummyTest()

const TestDescription & CxxTest::TestTracker::dummyTest | ( |  | ) | const

private

Definition at line 56 of file TestTracker.cpp.

{
return dummySuite().testDescription(0);
}
CxxTest::SuiteDescription::testDescription
virtual const TestDescription & testDescription(unsigned) const =0
CxxTest::TestTracker::dummySuite
const SuiteDescription & dummySuite() const
Definition TestTracker.cpp:61

## dummyWorld()

const WorldDescription & CxxTest::TestTracker::dummyWorld | ( |  | ) | const

private

Definition at line 66 of file TestTracker.cpp.

{
return _dummyWorld;
}
CxxTest::TestTracker::_dummyWorld
DummyWorldDescription _dummyWorld
Definition TestTracker.h:87

## enterSuite()

void CxxTest::TestTracker::enterSuite | ( | const SuiteDescription & | sd | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 83 of file TestTracker.cpp.

{
setSuite( &sd );
_testFailedAsserts = _suiteFailedTests = 0;
_l->enterSuite(sd);
}
CxxTest::TestTracker::setSuite
void setSuite(const SuiteDescription *s)
Definition TestTracker.cpp:222
CxxTest::TestTracker::_l
TestListener * _l
Definition TestTracker.h:89

## enterTest()

void CxxTest::TestTracker::enterTest | ( | const TestDescription & | td | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 90 of file TestTracker.cpp.

{
setTest( &td );
_testFailedAsserts = false;
_l->enterTest(td);
}
CxxTest::TestTracker::setTest
void setTest(const TestDescription *t)
Definition TestTracker.cpp:228

## enterWorld()

void CxxTest::TestTracker::enterWorld | ( | const WorldDescription & | wd | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 76 of file TestTracker.cpp.

{
setWorld( &wd );
_warnings = _failedTests = _testFailedAsserts = _suiteFailedTests = _failedSuites = 0;
_l->enterWorld( wd );
}
CxxTest::TestTracker::setWorld
void setWorld(const WorldDescription *w)
Definition TestTracker.cpp:216

## failedAssert()

void CxxTest::TestTracker::failedAssert | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 132 of file TestTracker.cpp.

{
countFailure();
_l->failedAssert( file, line, expression );
}
CxxTest::TestTracker::countFailure
void countFailure()
Definition TestTracker.cpp:238

## failedAssertDelta()

void CxxTest::TestTracker::failedAssertDelta | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | dStr,
|  | const char * | x,
|  | const char * | y,
|  | const char * | d )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 155 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertDelta( file, line, xStr, yStr, dStr, x, y, d );
}
x
Variable x
Definition cfModGcd.cc:4090
y
const CanonicalForm int const CFList const Variable & y
Definition facAbsFact.cc:53

## failedAssertDiffers()

void CxxTest::TestTracker::failedAssertDiffers | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | value )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 163 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertDiffers( file, line, xStr, yStr, value );
}

## failedAssertEquals()

void CxxTest::TestTracker::failedAssertEquals | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | x,
|  | const char * | y )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 138 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertEquals( file, line, xStr, yStr, x, y );
}

## failedAssertLessThan()

void CxxTest::TestTracker::failedAssertLessThan | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | x,
|  | const char * | y )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 171 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertLessThan( file, line, xStr, yStr, x, y );
}

## failedAssertLessThanEquals()

void CxxTest::TestTracker::failedAssertLessThanEquals | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | x,
|  | const char * | y )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 179 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertLessThanEquals( file, line, xStr, yStr, x, y );
}

## failedAssertPredicate()

void CxxTest::TestTracker::failedAssertPredicate | ( | const char * | file,
|  | unsigned | line,
|  | const char * | predicate,
|  | const char * | xStr,
|  | const char * | x )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 187 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertPredicate( file, line, predicate, xStr, x );
}

## failedAssertRelation()

void CxxTest::TestTracker::failedAssertRelation | ( | const char * | file,
|  | unsigned | line,
|  | const char * | relation,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | x,
|  | const char * | y )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 194 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertRelation( file, line, relation, xStr, yStr, x, y );
}

## failedAssertSameData()

void CxxTest::TestTracker::failedAssertSameData | ( | const char * | file,
|  | unsigned | line,
|  | const char * | xStr,
|  | const char * | yStr,
|  | const char * | sizeStr,
|  | const void * | x,
|  | const void * | y,
|  | unsigned | size )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 146 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertSameData( file, line, xStr, yStr, sizeStr, x, y, size );
}
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600

## failedAssertThrows()

void CxxTest::TestTracker::failedAssertThrows | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression,
|  | const char * | type,
|  | bool | otherThrown )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 202 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertThrows( file, line, expression, type, otherThrown );
}

## failedAssertThrowsNot()

void CxxTest::TestTracker::failedAssertThrowsNot | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 210 of file TestTracker.cpp.

{
countFailure();
_l->failedAssertThrowsNot( file, line, expression );
}

## failedSuites()

unsigned CxxTest::TestTracker::failedSuites | ( |  | ) | const

inline

Definition at line 40 of file TestTracker.h.

{ return _failedSuites; }

## failedTest()

void CxxTest::TestTracker::failedTest | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 126 of file TestTracker.cpp.

{
countFailure();
_l->failedTest( file, line, expression );
}

## failedTests()

unsigned CxxTest::TestTracker::failedTests | ( |  | ) | const

inline

Definition at line 37 of file TestTracker.h.

{ return _failedTests; }

## fixSuite()

const SuiteDescription * CxxTest::TestTracker::fixSuite | ( | const SuiteDescription * | d | ) | const

Definition at line 46 of file TestTracker.cpp.

{
return d ? d : &dummySuite();
}

## fixTest()

const TestDescription * CxxTest::TestTracker::fixTest | ( | const TestDescription * | d | ) | const

Definition at line 41 of file TestTracker.cpp.

{
return d ? d : &dummyTest();
}
CxxTest::TestTracker::dummyTest
const TestDescription & dummyTest() const
Definition TestTracker.cpp:56

## fixWorld()

const WorldDescription * CxxTest::TestTracker::fixWorld | ( | const WorldDescription * | d | ) | const

Definition at line 51 of file TestTracker.cpp.

{
return d ? d : &dummyWorld();
}

## initialize()

void CxxTest::TestTracker::initialize | ( |  | ) |

private

Definition at line 28 of file TestTracker.cpp.

{
_warnings = 0;
_failedTests = 0;
_testFailedAsserts = 0;
_suiteFailedTests = 0;
_failedSuites = 0;
setListener( 0 );
_world = 0;
_suite = 0;
_test = 0;
}
CxxTest::TestTracker::_test
const TestDescription * _test
Definition TestTracker.h:92
CxxTest::TestTracker::_world
const WorldDescription * _world
Definition TestTracker.h:90
CxxTest::TestTracker::setListener
void setListener(TestListener *l)
Definition TestTracker.cpp:71
CxxTest::TestTracker::_suite
const SuiteDescription * _suite
Definition TestTracker.h:91

## leaveSuite()

void CxxTest::TestTracker::leaveSuite | ( | const SuiteDescription & | sd | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 103 of file TestTracker.cpp.

{
_l->leaveSuite( sd );
setSuite( 0 );
}

## leaveTest()

void CxxTest::TestTracker::leaveTest | ( | const TestDescription & | td | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 97 of file TestTracker.cpp.

{
_l->leaveTest( td );
setTest( 0 );
}

## leaveWorld()

void CxxTest::TestTracker::leaveWorld | ( | const WorldDescription & | wd | ) |

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 109 of file TestTracker.cpp.

{
_l->leaveWorld( wd );
setWorld( 0 );
}

## operator=()

TestTracker & CxxTest::TestTracker::operator= | ( | const TestTracker & |  | ) |

private

## setListener()

void CxxTest::TestTracker::setListener | ( | TestListener * | l | ) |

private

Definition at line 71 of file TestTracker.cpp.

{
_l = l ? l : &_dummyListener;
}
l
int l
Definition cfEzgcd.cc:100
CxxTest::TestTracker::_dummyListener
TestListener _dummyListener
Definition TestTracker.h:86

## setSuite()

void CxxTest::TestTracker::setSuite | ( | const SuiteDescription * | s | ) |

private

Definition at line 222 of file TestTracker.cpp.

{
_suite = fixSuite( s );
setTest( 0 );
}
CxxTest::TestTracker::fixSuite
const SuiteDescription * fixSuite(const SuiteDescription *d) const
Definition TestTracker.cpp:46
CxxTest::s
char * s
Definition ValueTraits.h:143

## setTest()

void CxxTest::TestTracker::setTest | ( | const TestDescription * | t | ) |

private

Definition at line 228 of file TestTracker.cpp.

{
_test = fixTest( t );
}
CxxTest::TestTracker::fixTest
const TestDescription * fixTest(const TestDescription *d) const
Definition TestTracker.cpp:41

## setWorld()

void CxxTest::TestTracker::setWorld | ( | const WorldDescription * | w | ) |

private

Definition at line 216 of file TestTracker.cpp.

{
_world = fixWorld( w );
setSuite( 0 );
}
CxxTest::TestTracker::fixWorld
const WorldDescription * fixWorld(const WorldDescription *d) const
Definition TestTracker.cpp:51
w
const CanonicalForm & w
Definition facAbsFact.cc:51

## suite()

const SuiteDescription & CxxTest::TestTracker::suite | ( |  | ) | const

inline

Definition at line 29 of file TestTracker.h.

{ return *_suite; }

## suiteFailed()

bool CxxTest::TestTracker::suiteFailed | ( |  | ) | const

inline

Definition at line 33 of file TestTracker.h.

{ return (suiteFailedTests() > 0); }
CxxTest::TestTracker::suiteFailedTests
unsigned suiteFailedTests() const
Definition TestTracker.h:39

## suiteFailedTests()

unsigned CxxTest::TestTracker::suiteFailedTests | ( |  | ) | const

inline

Definition at line 39 of file TestTracker.h.

{ return _suiteFailedTests; }

## test()

const TestDescription & CxxTest::TestTracker::test | ( |  | ) | const

inline

Definition at line 28 of file TestTracker.h.

{ return *_test; }

## testFailed()

bool CxxTest::TestTracker::testFailed | ( |  | ) | const

inline

Definition at line 32 of file TestTracker.h.

{ return (testFailedAsserts() > 0); }
CxxTest::TestTracker::testFailedAsserts
unsigned testFailedAsserts() const
Definition TestTracker.h:38

## testFailedAsserts()

unsigned CxxTest::TestTracker::testFailedAsserts | ( |  | ) | const

inline

Definition at line 38 of file TestTracker.h.

{ return _testFailedAsserts; }

## trace()

void CxxTest::TestTracker::trace | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 115 of file TestTracker.cpp.

{
_l->trace( file, line, expression );
}

## tracker()

TestTracker & CxxTest::TestTracker::tracker | ( |  | ) |

static

Definition at line 22 of file TestTracker.cpp.

{
STATIC_INST_VAR TestTracker theTracker;
return theTracker;
}
CxxTest::TestTracker::TestTracker
TestTracker(const TestTracker &)
STATIC_INST_VAR
#define STATIC_INST_VAR
Definition globaldefs.h:10

## warning()

void CxxTest::TestTracker::warning | ( | const char * | file,
|  | unsigned | line,
|  | const char * | expression )

virtual

Reimplemented from CxxTest::TestListener.

Definition at line 120 of file TestTracker.cpp.

{
countWarning();
_l->warning( file, line, expression );
}
CxxTest::TestTracker::countWarning
void countWarning()
Definition TestTracker.cpp:233

## warnings()

unsigned CxxTest::TestTracker::warnings | ( |  | ) | const

inline

Definition at line 36 of file TestTracker.h.

{ return _warnings; }

## world()

const WorldDescription & CxxTest::TestTracker::world | ( |  | ) | const

inline

Definition at line 30 of file TestTracker.h.

{ return *_world; }

## worldFailed()

bool CxxTest::TestTracker::worldFailed | ( |  | ) | const

inline

Definition at line 34 of file TestTracker.h.

{ return (failedSuites() > 0); }
CxxTest::TestTracker::failedSuites
unsigned failedSuites() const
Definition TestTracker.h:40

## Friends And Related Symbol Documentation

## TestRunner

friend class TestRunner

friend

Definition at line 104 of file TestTracker.h.

## Field Documentation

## _created

bool CxxTest::TestTracker::_created = false

private

Definition at line 85 of file TestTracker.h.

## _dummyListener

TestListener CxxTest::TestTracker::_dummyListener

private

Definition at line 86 of file TestTracker.h.

## _dummyWorld

DummyWorldDescription CxxTest::TestTracker::_dummyWorld

private

Definition at line 87 of file TestTracker.h.

## _failedSuites

unsigned CxxTest::TestTracker::_failedSuites

private

Definition at line 88 of file TestTracker.h.

## _failedTests

unsigned CxxTest::TestTracker::_failedTests

private

Definition at line 88 of file TestTracker.h.

## _l

TestListener* CxxTest::TestTracker::_l

private

Definition at line 89 of file TestTracker.h.

## _suite

const SuiteDescription* CxxTest::TestTracker::_suite

private

Definition at line 91 of file TestTracker.h.

## _suiteFailedTests

unsigned CxxTest::TestTracker::_suiteFailedTests

private

Definition at line 88 of file TestTracker.h.

## _test

const TestDescription* CxxTest::TestTracker::_test

private

Definition at line 92 of file TestTracker.h.

## _testFailedAsserts

unsigned CxxTest::TestTracker::_testFailedAsserts

private

Definition at line 88 of file TestTracker.h.

## _warnings

unsigned CxxTest::TestTracker::_warnings

private

Definition at line 88 of file TestTracker.h.

## _world

const WorldDescription* CxxTest::TestTracker::_world

private

Definition at line 90 of file TestTracker.h.

The documentation for this class was generated from the following files:

- libpolys/tests/cxxtest/TestTracker.h
- libpolys/tests/cxxtest/TestTracker.cpp