Fix how Jenkins is now handling JUNIT XML.
authorBrian Aker <brian@tangent.org>
Sat, 1 Feb 2014 09:36:40 +0000 (10:36 +0100)
committerBrian Aker <brian@tangent.org>
Sat, 1 Feb 2014 09:36:40 +0000 (10:36 +0100)
libtest/formatter.cc

index ad5b163541b4f14a11e003431331f7facc79ea79..198b9e7df75d63b1afd92a64dc69ee71f4850760 100644 (file)
@@ -206,8 +206,10 @@ void Formatter::xml(libtest::Framework& framework_, std::ofstream& output)
   {
     output << "\t<testsuite name=" 
       << escape4XML((*framework_iter)->name(), escaped_string)
-      << "  classname=\"\" package=\"\">" 
-      << std::endl;
+#if 0
+      << "  classname=\"\" package=\"\"" 
+#endif
+      << ">" << std::endl;
 
     for (TestCases::iterator case_iter= (*framework_iter)->formatter()->testcases().begin();
          case_iter != (*framework_iter)->formatter()->testcases().end();
@@ -217,23 +219,27 @@ void Formatter::xml(libtest::Framework& framework_, std::ofstream& output)
         << escape4XML((*case_iter)->name(), escaped_string)
         << " time=\"" 
         << (*case_iter)->timer().elapsed_milliseconds() 
-        << "\">
+        << "\"" 
         << std::endl;
 
       switch ((*case_iter)->result())
       {
         case TEST_SKIPPED:
+        output << ">" << std::endl;
         output << "\t\t <skipped/>" << std::endl;
+        output << "\t\t</testcase>" << std::endl;
         break;
 
         case TEST_FAILURE:
+        output << ">" << std::endl;
         output << "\t\t <failure message=\"\" type=\"\"/>"<< std::endl;
+        output << "\t\t</testcase>" << std::endl;
         break;
 
         case TEST_SUCCESS:
+        output << "/>" << std::endl;
         break;
       }
-      output << "\t\t</testcase>" << std::endl;
     }
     output << "\t</testsuite>" << std::endl;
   }