| 147 | } |
| 148 | |
| 149 | void printXML() const { |
| 150 | verify(); |
| 151 | fmt::print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); |
| 152 | fmt::print("<CoverageTool>\n"); |
| 153 | if (codeProbes.empty()) { |
| 154 | fmt::print("\t<CoverageCases/>\n"); |
| 155 | fmt::print("\t<Inputs/>\n"); |
| 156 | } else { |
| 157 | std::vector<std::string_view> files; |
| 158 | fmt::print("\t<CoverageCases>\n"); |
| 159 | for (auto probe : codeProbes) { |
| 160 | files.push_back(probe.first.file); |
| 161 | fmt::print("\t\t<Case File=\"{}\" Line=\"{}\" Comment=\"{}\" Condition=\"{}\"/>\n", |
| 162 | probe.first.file, |
| 163 | probe.first.line, |
| 164 | probe.second->comment(), |
| 165 | probe.second->condition()); |
| 166 | } |
| 167 | fmt::print("\t</CoverageCases>\n"); |
| 168 | fmt::print("\t<Inputs>\n"); |
| 169 | for (auto const& f : files) { |
| 170 | fmt::print("\t\t<Input>{}</Input>\n", f); |
| 171 | } |
| 172 | fmt::print("\t</Inputs>\n"); |
| 173 | } |
| 174 | fmt::print("</CoverageTool>\n"); |
| 175 | } |
| 176 | |
| 177 | void printJSON(std::vector<std::string> const& context = std::vector<std::string>()) const { |
| 178 | verify(); |