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

`#include <TestRunner.h>`

## Data Structures

class | StateGuard
class | WorldGuard

## Static Public Member Functions

static void | runAllTests (TestListener &listener)
static void | runAllTests (TestListener *listener)

## Private Member Functions

void | runWorld ()
void | runSuite (SuiteDescription &sd)
void | runTest (TestDescription &td)

## Detailed Description

Definition at line 17 of file TestRunner.h.

## Member Function Documentation

## runAllTests() [1/2]

void CxxTest::TestRunner::runAllTests | ( | TestListener & | listener | ) |

inline static

Definition at line 20 of file TestRunner.h.

{
tracker().setListener( &listener );
_TS_TRY { TestRunner().runWorld(); }
_TS_LAST_CATCH( { tracker().failedTest( __FILE__, __LINE__, "Exception thrown from world" ); } );
tracker().setListener( 0 );
}
_TS_TRY
#define _TS_TRY
Definition TestSuite.h:209
_TS_LAST_CATCH
#define _TS_LAST_CATCH(b)
Definition TestSuite.h:215
CxxTest::TestTracker::failedTest
void failedTest(const char *file, unsigned line, const char *expression)
Definition TestTracker.cpp:126
CxxTest::TestTracker::setListener
void setListener(TestListener *l)
Definition TestTracker.cpp:71
CxxTest::tracker
TestTracker & tracker()
Definition TestTracker.h:111

## runAllTests() [2/2]

void CxxTest::TestRunner::runAllTests | ( | TestListener * | listener | ) |

inline static

Definition at line 28 of file TestRunner.h.

{
if ( listener ) {
listener->warning( __FILE__, __LINE__, "Deprecated; Use runAllTests( TestListener & )" );
runAllTests( *listener );
}
}
CxxTest::TestRunner::runAllTests
static void runAllTests(TestListener &listener)
Definition TestRunner.h:20

## runSuite()

void CxxTest::TestRunner::runSuite | ( | SuiteDescription & | sd | ) |

inline private

Definition at line 53 of file TestRunner.h.

{
StateGuard sg;
tracker().enterSuite( sd );
if ( sd.setUp() ) {
for ( TestDescription *td = sd.firstTest(); td; td = td->next() )
if ( td->active() )
runTest( *td );
sd.tearDown();
}
tracker().leaveSuite( sd );
}
CxxTest::TestRunner::StateGuard
Definition TestRunner.h:81
CxxTest::TestRunner::runTest
void runTest(TestDescription &td)
Definition TestRunner.h:68
CxxTest::TestTracker::enterSuite
void enterSuite(const SuiteDescription &sd)
Definition TestTracker.cpp:83
CxxTest::TestTracker::leaveSuite
void leaveSuite(const SuiteDescription &sd)
Definition TestTracker.cpp:103

## runTest()

void CxxTest::TestRunner::runTest | ( | TestDescription & | td | ) |

inline private

Definition at line 68 of file TestRunner.h.

{
StateGuard sg;
tracker().enterTest( td );
if ( td.setUp() ) {
td.run();
td.tearDown();
}
tracker().leaveTest( td );
}
CxxTest::TestTracker::enterTest
void enterTest(const TestDescription &td)
Definition TestTracker.cpp:90
CxxTest::TestTracker::leaveTest
void leaveTest(const TestDescription &td)
Definition TestTracker.cpp:97

## runWorld()

void CxxTest::TestRunner::runWorld | ( |  | ) |

inline private

Definition at line 37 of file TestRunner.h.

{
RealWorldDescription wd;
WorldGuard sg;
tracker().enterWorld( wd );
if ( wd.setUp() ) {
for ( SuiteDescription *sd = wd.firstSuite(); sd; sd = sd->next() )
if ( sd->active() )
runSuite( *sd );
wd.tearDown();
}
tracker().leaveWorld( wd );
}
CxxTest::TestRunner::WorldGuard
Definition TestRunner.h:106
CxxTest::TestRunner::runSuite
void runSuite(SuiteDescription &sd)
Definition TestRunner.h:53
CxxTest::TestTracker::leaveWorld
void leaveWorld(const WorldDescription &wd)
Definition TestTracker.cpp:109
CxxTest::TestTracker::enterWorld
void enterWorld(const WorldDescription &wd)
Definition TestTracker.cpp:76

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

- libpolys/tests/cxxtest/TestRunner.h