MCPcopy Create free account
hub / github.com/cpputest/cpputest / runOneTestInCurrentProcess

Method runOneTestInCurrentProcess

src/CppUTest/Utest.cpp:198–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void UtestShell::runOneTestInCurrentProcess(TestPlugin* plugin, TestResult& result)
199{
200 result.printVeryVerbose("\n-- before runAllPreTestAction: ");
201 plugin->runAllPreTestAction(*this, result);
202 result.printVeryVerbose("\n-- after runAllPreTestAction: ");
203
204 //save test context, so that test class can be tested
205 UtestShell* savedTest = UtestShell::getCurrent();
206 TestResult* savedResult = UtestShell::getTestResult();
207
208 UtestShell::setTestResult(&result);
209 UtestShell::setCurrentTest(this);
210
211 result.printVeryVerbose("\n---- before createTest: ");
212 Utest* testToRun = createTest();
213 result.printVeryVerbose("\n---- after createTest: ");
214
215 result.printVeryVerbose("\n------ before runTest: ");
216 testToRun->run();
217 result.printVeryVerbose("\n------ after runTest: ");
218
219 UtestShell::setCurrentTest(savedTest);
220 UtestShell::setTestResult(savedResult);
221
222 result.printVeryVerbose("\n---- before destroyTest: ");
223 destroyTest(testToRun);
224 result.printVeryVerbose("\n---- after destroyTest: ");
225
226 result.printVeryVerbose("\n-- before runAllPostTestAction: ");
227 plugin->runAllPostTestAction(*this, result);
228 result.printVeryVerbose("\n-- after runAllPostTestAction: ");
229}
230
231UtestShell *UtestShell::getNext() const
232{

Callers 3

TESTFunction · 0.80

Calls 4

runMethod · 0.80
printVeryVerboseMethod · 0.45
runAllPreTestActionMethod · 0.45
runAllPostTestActionMethod · 0.45

Tested by

no test coverage detected