My Project
Loading...
Searching...
No Matches
Data Structures | Static Public Member Functions | Private Member Functions
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]

static void CxxTest::TestRunner::runAllTests ( TestListener listener)
inlinestatic

Definition at line 20 of file TestRunner.h.

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

◆ runAllTests() [2/2]

static void CxxTest::TestRunner::runAllTests ( TestListener listener)
inlinestatic

Definition at line 28 of file TestRunner.h.

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

◆ runSuite()

void CxxTest::TestRunner::runSuite ( SuiteDescription sd)
inlineprivate

Definition at line 53 of file TestRunner.h.

54 {
55 StateGuard sg;
56
57 tracker().enterSuite( sd );
58 if ( sd.setUp() ) {
59 for ( TestDescription *td = sd.firstTest(); td; td = td->next() )
60 if ( td->active() )
61 runTest( *td );
62
63 sd.tearDown();
64 }
65 tracker().leaveSuite( sd );
66 }
void runTest(TestDescription &td)
Definition: TestRunner.h:68
void enterSuite(const SuiteDescription &sd)
Definition: TestTracker.cpp:83
void leaveSuite(const SuiteDescription &sd)

◆ runTest()

void CxxTest::TestRunner::runTest ( TestDescription td)
inlineprivate

Definition at line 68 of file TestRunner.h.

69 {
70 StateGuard sg;
71
72 tracker().enterTest( td );
73 if ( td.setUp() ) {
74 td.run();
75 td.tearDown();
76 }
77 tracker().leaveTest( td );
78 }
void enterTest(const TestDescription &td)
Definition: TestTracker.cpp:90
void leaveTest(const TestDescription &td)
Definition: TestTracker.cpp:97

◆ runWorld()

void CxxTest::TestRunner::runWorld ( )
inlineprivate

Definition at line 37 of file TestRunner.h.

38 {
39 RealWorldDescription wd;
40 WorldGuard sg;
41
42 tracker().enterWorld( wd );
43 if ( wd.setUp() ) {
44 for ( SuiteDescription *sd = wd.firstSuite(); sd; sd = sd->next() )
45 if ( sd->active() )
46 runSuite( *sd );
47
48 wd.tearDown();
49 }
50 tracker().leaveWorld( wd );
51 }
void runSuite(SuiteDescription &sd)
Definition: TestRunner.h:53
void leaveWorld(const WorldDescription &wd)
void enterWorld(const WorldDescription &wd)
Definition: TestTracker.cpp:76

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