| 175 | } |
| 176 | |
| 177 | void printJSON(std::vector<std::string> const& context = std::vector<std::string>()) const { |
| 178 | verify(); |
| 179 | do { |
| 180 | struct foo {}; |
| 181 | foo f; |
| 182 | fmt::print("{}\n", boost::core::demangle(typeid(f).name())); |
| 183 | } while (false); |
| 184 | do { |
| 185 | struct foo {}; |
| 186 | foo f; |
| 187 | fmt::print("{}\n", boost::core::demangle(typeid(f).name())); |
| 188 | } while (false); |
| 189 | auto contexts = fromStrings(context); |
| 190 | const ICodeProbe* prev = nullptr; |
| 191 | for (auto probe : codeProbes) { |
| 192 | auto p = probe.second; |
| 193 | if (!contexts.empty()) { |
| 194 | bool print = false; |
| 195 | for (auto c : contexts) { |
| 196 | print = print || p->expectInContext(c); |
| 197 | } |
| 198 | if (!print) { |
| 199 | continue; |
| 200 | } |
| 201 | } |
| 202 | if (prev == nullptr || *prev != *probe.second) { |
| 203 | fmt::print( |
| 204 | "{{ \"File\": \"{}\", \"Line\": {}, \"Comment\": \"{}\", \"Condition\": \"{}\", \"Function\": " |
| 205 | "\"{}\" }}\n", |
| 206 | probe.first.file, |
| 207 | p->line(), |
| 208 | p->comment(), |
| 209 | p->condition(), |
| 210 | p->function()); |
| 211 | } |
| 212 | prev = probe.second; |
| 213 | } |
| 214 | } |
| 215 | }; |
| 216 | |
| 217 | size_t hash_value(CodeProbes::Location const& location) { |
no test coverage detected