FastLED 3.10.6
Loading...
Searching...
No Matches

◆ testRunEnd()

void fl::test::XMLReporter::testRunEnd ( const TestStats & stats)
overridevirtual

Implements fl::test::IReporter.

Definition at line 627 of file fltest.cpp.hpp.

627 {
628 if (!mOutput) return;
629
630 fl::sstream ss;
631
632 // XML header
633 ss << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
634
635 // Testsuite element with summary
636 ss << "<testsuite name=\"" << escapeXml(mSuiteName) << "\" ";
637 ss << "tests=\"" << stats.mTestCasesRun << "\" ";
638 ss << "failures=\"" << stats.mTestCasesFailed << "\" ";
639 ss << "errors=\"0\" ";
640 ss << "skipped=\"" << stats.mTestCasesSkipped << "\">\n";
641
642 // Add all test case results
643 for (fl::size i = 0; i < mTestCaseResults.size(); ++i) {
644 ss << mTestCaseResults[i];
645 }
646
647 ss << "</testsuite>\n";
648
649 *mOutput = ss.str();
650}
string str() const FL_NO_EXCEPT
Definition strstream.h:43
static fl::string escapeXml(const char *text) FL_NO_EXCEPT
fl::string * mOutput
Definition fltest.h:574
const char * mSuiteName
Definition fltest.h:575
fl::vector< fl::string > mTestCaseResults
Definition fltest.h:581

References escapeXml(), fl::FL_NO_EXCEPT, mOutput, mSuiteName, mTestCaseResults, and fl::sstream::str().

+ Here is the call graph for this function: