Esempio n. 1
0
void Utest::run(TestResult& result)
{
	//save test context, so that test class can be tested
	Utest* savedTest = getCurrent();
	TestResult* savedResult = getTestResult();

	result.countRun();
	setTestResult(&result);
	setCurrentTest(this);

	if (executePlatformSpecificSetup()) {
		executePlatformSpecificTestBody();
	}
	executePlatformSpecificTeardown();

	setCurrentTest(savedTest);
	setTestResult(savedResult);
}
Esempio n. 2
0
void UtestShell::runOneTestInCurrentProcess(TestPlugin* plugin, TestResult& result)
{
    plugin->runAllPreTestAction(*this, result);

    //save test context, so that test class can be tested
    UtestShell* savedTest = UtestShell::getCurrent();
    TestResult* savedResult = UtestShell::getTestResult();

    result.countRun();
    UtestShell::setTestResult(&result);
    UtestShell::setCurrentTest(this);

    Utest* testToRun = createTest();
    testToRun->run();
    destroyTest(testToRun);

    UtestShell::setCurrentTest(savedTest);
    UtestShell::setTestResult(savedResult);

    plugin->runAllPostTestAction(*this, result);
}