Returns (non_empty_file_count, zero_line_count, first_file_hash) among matched regions for diagnostic purposes.
| 305 | /// Returns (non_empty_file_count, zero_line_count, first_file_hash) |
| 306 | /// among matched regions for diagnostic purposes. |
| 307 | std::tuple<size_t, size_t, uint64_t> diagCoverageRegions(const std::vector<CovCounter> & name_refs) |
| 308 | { |
| 309 | ensureCoverageMapLoaded(); |
| 310 | size_t non_empty = 0, zero_line = 0; |
| 311 | uint64_t first_file_hash = 0; |
| 312 | for (const auto & [name_hash, func_hash, counter_id, min_depth] : name_refs) |
| 313 | { |
| 314 | auto it = g_coverage_map.find(CoverageKey{name_hash, func_hash, counter_id}); |
| 315 | if (it == g_coverage_map.end()) continue; |
| 316 | const CoverageRegion & r = it->second; |
| 317 | if (!r.file.empty()) |
| 318 | { |
| 319 | ++non_empty; |
| 320 | if (first_file_hash == 0) |
| 321 | { |
| 322 | /// Store length of first file as a proxy diagnostic |
| 323 | first_file_hash = static_cast<uint64_t>(r.file.size()) << 32 |
| 324 | | static_cast<uint64_t>(r.line_start); |
| 325 | } |
| 326 | } |
| 327 | if (r.line_start == 0) ++zero_line; |
| 328 | } |
| 329 | return {non_empty, zero_line, first_file_hash}; |
| 330 | } |
| 331 | |
| 332 | CurrentCoverageRegions getCurrentCoverageRegions() |
| 333 | { |
no test coverage detected