| 12214 | } |
| 12215 | |
| 12216 | void JunitReporter::writeSection(std::string const &className, std::string const &rootName, |
| 12217 | SectionNode const §ionNode) { |
| 12218 | std::string name = trim(sectionNode.stats.sectionInfo.name); |
| 12219 | if (!rootName.empty()) |
| 12220 | name = rootName + '/' + name; |
| 12221 | |
| 12222 | if (!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) { |
| 12223 | XmlWriter::ScopedElement e = xml.scopedElement("testcase"); |
| 12224 | if (className.empty()) { |
| 12225 | xml.writeAttribute("classname", name); |
| 12226 | xml.writeAttribute("name", "root"); |
| 12227 | } else { |
| 12228 | xml.writeAttribute("classname", className); |
| 12229 | xml.writeAttribute("name", name); |
| 12230 | } |
| 12231 | xml.writeAttribute("time", ::Catch::Detail::stringify(sectionNode.stats.durationInSeconds)); |
| 12232 | |
| 12233 | writeAssertions(sectionNode); |
| 12234 | |
| 12235 | if (!sectionNode.stdOut.empty()) |
| 12236 | xml.scopedElement("system-out").writeText(trim(sectionNode.stdOut), false); |
| 12237 | if (!sectionNode.stdErr.empty()) |
| 12238 | xml.scopedElement("system-err").writeText(trim(sectionNode.stdErr), false); |
| 12239 | } |
| 12240 | for (auto const &childNode : sectionNode.childSections) |
| 12241 | if (className.empty()) |
| 12242 | writeSection(name, "", *childNode); |
| 12243 | else |
| 12244 | writeSection(className, name, *childNode); |
| 12245 | } |
| 12246 | |
| 12247 | void JunitReporter::writeAssertions(SectionNode const §ionNode) { |
| 12248 | for (auto const &assertion : sectionNode.assertions) |
nothing calls this directly
no test coverage detected