MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / writeSection

Method writeSection

Bcore/src/main/cpp/Dobby/tests/catch.hpp:12216–12245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12214}
12215
12216void JunitReporter::writeSection(std::string const &className, std::string const &rootName,
12217 SectionNode const &sectionNode) {
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
12247void JunitReporter::writeAssertions(SectionNode const &sectionNode) {
12248 for (auto const &assertion : sectionNode.assertions)

Callers

nothing calls this directly

Calls 4

trimFunction · 0.85
stringifyFunction · 0.85
scopedElementMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected