Separate dumps by state: enable/disable Success and Failed tests
[anna.git] / example / diameter / launcher / testing / TestManager.cpp
index bd9bbfc..e9cca9b 100644 (file)
@@ -82,7 +82,8 @@ TestManager::TestManager() :
       anna::timex::TimeEventObserver("TestManager") {
   a_timeController = NULL;
   a_reportsDirectory = "./";
-  a_dumpReports = false;
+  a_dumpSuccessfulReports = false;
+  a_dumpFailedReports = false;
   a_dumpHexMessages = false;
   a_synchronousAmount = 1;
   a_poolRepeats = 0; // repeat disabled by default
@@ -460,7 +461,8 @@ throw() {
     result->createAttribute("InProgressLimit", "<no limit>");
   else
     result->createAttribute("InProgressLimit", a_inProgressLimit);
-  result->createAttribute("DumpReports", (a_dumpReports ? "yes":"no"));
+  result->createAttribute("DumpSuccessfulReports", (a_dumpSuccessfulReports ? "yes":"no"));
+  result->createAttribute("DumpFailedReports", (a_dumpFailedReports ? "yes":"no"));
   result->createAttribute("DumpHexMessages", (a_dumpHexMessages ? "yes":"no"));
   result->createAttribute("ReportsDirectory", a_reportsDirectory);
   if (a_clock) {
@@ -471,9 +473,11 @@ 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::Success) && (!getDumpSuccessfulReports())) continue;
+      if (((*it).second->getState() == TestCase::State::Failed) && (!getDumpFailedReports())) continue;
       (*it).second->asXML(testCases);
     }
   }