X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestManager.cpp;h=01487fea7a0790454fbd3fef28e3f4e2f9bfe96e;hb=0a29aaeb86cc31d808f88d8c9a046f5858ed3089;hp=ee6be631a2e060e244d2562c90e67befc2a791c8;hpb=13b6f0196c2091f9e88a0778155cdcb733cfdafd;p=anna.git diff --git a/example/diameter/launcher/testing/TestManager.cpp b/example/diameter/launcher/testing/TestManager.cpp index ee6be63..01487fe 100644 --- a/example/diameter/launcher/testing/TestManager.cpp +++ b/example/diameter/launcher/testing/TestManager.cpp @@ -82,7 +82,12 @@ TestManager::TestManager() : anna::timex::TimeEventObserver("TestManager") { a_timeController = NULL; a_reportsDirectory = "./"; - a_dumpReports = false; + + a_dumpInProgressReports = false; + a_dumpInitializedReports = false; + a_dumpFailedReports = false; + a_dumpSuccessReports = false; + a_dumpHexMessages = false; a_synchronousAmount = 1; a_poolRepeats = 0; // repeat disabled by default @@ -262,6 +267,7 @@ bool TestManager::clearPool() throw() { a_currentTestIt = a_testPool.end(); a_poolCycle = 1; configureTTPS(0); // stop + a_statSummary.clear(); return true; } @@ -279,14 +285,18 @@ bool TestManager::resetPool(bool hard) throw() { bool TestManager::tick() throw() { LOGDEBUG(anna::Logger::debug("New test clock tick !", ANNA_FILE_LOCATION)); + return execTestCases(a_synchronousAmount); +} + +bool TestManager::execTestCases(int sync_amount) throw() { if (!tests()) { - LOGWARNING(anna::Logger::warning("Testing pool is empty. You need programming. Stopping test clock", ANNA_FILE_LOCATION)); + LOGWARNING(anna::Logger::warning("Testing pool is empty. You need programming", ANNA_FILE_LOCATION)); return false; } // Synchronous sendings per tick: - int count = a_synchronousAmount; + int count = sync_amount; while (count > 0) { if (!nextTestCase()) return false; // stop the clock count--; @@ -455,7 +465,10 @@ throw() { result->createAttribute("InProgressLimit", ""); else result->createAttribute("InProgressLimit", a_inProgressLimit); - result->createAttribute("DumpReports", (a_dumpReports ? "yes":"no")); + result->createAttribute("DumpInitializedReports", (a_dumpInitializedReports ? "yes":"no")); + result->createAttribute("DumpInProgressReports", (a_dumpInProgressReports ? "yes":"no")); + result->createAttribute("DumpFailedReports", (a_dumpFailedReports ? "yes":"no")); + result->createAttribute("DumpSuccessReports", (a_dumpSuccessReports ? "yes":"no")); result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no")); result->createAttribute("ReportsDirectory", a_reportsDirectory); if (a_clock) { @@ -466,9 +479,13 @@ throw() { if (a_currentTestIt != a_testPool.end()) { result->createAttribute("CurrentTestCaseId", (*a_currentTestIt).first); } - if (a_dumpReports && poolSize != 0) { + if (poolSize != 0) { anna::xml::Node* testCases = result->createChild("TestCases"); for (test_pool_it it = a_testPool.begin(); it != a_testPool.end(); it++) { + if (((*it).second->getState() == TestCase::State::Initialized) && (!getDumpInitializedReports())) continue; + if (((*it).second->getState() == TestCase::State::InProgress) && (!getDumpInProgressReports())) continue; + if (((*it).second->getState() == TestCase::State::Failed) && (!getDumpFailedReports())) continue; + if (((*it).second->getState() == TestCase::State::Success) && (!getDumpSuccessReports())) continue; (*it).second->asXML(testCases); } }