MCPcopy Create free account
hub / github.com/FlightGear/flightgear / run

Method run

3rdparty/cppunit/src/cppunit/TestCase.cpp:52–100  ·  view source on GitHub ↗

Run the test and catch any exceptions that are triggered by it

Source from the content-addressed store, hash-verified

50
51/// Run the test and catch any exceptions that are triggered by it
52void
53TestCase::run( TestResult *result )
54{
55 result->startTest(this);
56/*
57 try {
58 setUp();
59
60 try {
61 runTest();
62 }
63 catch ( Exception &e ) {
64 Exception *copy = e.clone();
65 result->addFailure( this, copy );
66 }
67 catch ( std::exception &e ) {
68 result->addError( this, new Exception( Message( "uncaught std::exception",
69 e.what() ) ) );
70 }
71 catch (...) {
72 Exception *e = new Exception( Message( "uncaught unknown exception" ) );
73 result->addError( this, e );
74 }
75
76 try {
77 tearDown();
78 }
79 catch (...) {
80 result->addError( this, new Exception( Message( "tearDown() failed" ) ) );
81 }
82 }
83 catch (...) {
84 result->addError( this, new Exception( Message( "setUp() failed" ) ) );
85 }
86*/
87 if ( result->protect( TestCaseMethodFunctor( this, &TestCase::setUp ),
88 this,
89 "setUp() failed" ) )
90 {
91 result->protect( TestCaseMethodFunctor( this, &TestCase::runTest ),
92 this );
93 }
94
95 result->protect( TestCaseMethodFunctor( this, &TestCase::tearDown ),
96 this,
97 "tearDown() failed" );
98
99 result->endTest( this );
100}
101
102
103/// All the work for runTest is deferred to subclasses

Callers 2

runTestMethod · 0.45
mainFunction · 0.45

Calls 4

TestCaseMethodFunctorFunction · 0.85
startTestMethod · 0.45
protectMethod · 0.45
endTestMethod · 0.45

Tested by

no test coverage detected