void TestRegistry::runAllTests(TestResult& result)
{
    bool groupStart = true;

    result.testsStarted();
    for (UtestShell *test = tests_; test != NULL; test = test->getNext()) {
        if (runInSeperateProcess_) test->setRunInSeperateProcess();
        if (runIgnored_) test->setRunIgnored();

        if (groupStart) {
            result.currentGroupStarted(test);
            groupStart = false;
        }

        result.countTest();
        if (testShouldRun(test, result)) {
            result.currentTestStarted(test);
            test->runOneTest(firstPlugin_, result);
            result.currentTestEnded(test);
        }

        if (endOfGroup(test)) {
            groupStart = true;
            result.currentGroupEnded(test);
        }
    }
    result.testsEnded();
    currentRepetition_++;
}
Exemplo n.º 2
0
static void helperDoRunOneTest(void* data)
{
	HelperTestRunInfo* runInfo = (HelperTestRunInfo*) data;

	UtestShell* shell = runInfo->shell_;
	TestPlugin* plugin = runInfo->plugin_;
	TestResult* result = runInfo->result_;

	shell->runOneTest(plugin, *result);
}
Exemplo n.º 3
0
TEST(gtest, SimpleGoogleTestGetCalled)
{
	StringBufferTestOutput output;
	TestResult result(output);
	TestPlugin plugin("dummy");

	TestRegistry* registry = TestRegistry::getCurrentRegistry();
	UtestShell * shell = registry->findTestWithName("GTestEqual");
	g_GTestEqual_has_been_called = false;
	shell->runOneTest(&plugin, result);

	CHECK(g_GTestEqual_has_been_called);
}