| 3186 | } |
| 3187 | |
| 3188 | int cbm_store_coverage_get_scope(cbm_store_t *s, const char *project, const char *scope, |
| 3189 | cbm_coverage_row_t **out, int *count) { |
| 3190 | static const char sql[] = "SELECT rel_path, kind, detail FROM index_coverage " |
| 3191 | "WHERE project = ?1 AND (length(?2) = 0 OR rel_path = ?2 OR " |
| 3192 | " (length(rel_path) > length(?2) " |
| 3193 | " AND substr(rel_path, 1, length(?2)) = ?2 " |
| 3194 | " AND substr(rel_path, length(?2) + 1, 1) = '/') OR " |
| 3195 | " (kind = 'not_indexed_dir' AND length(rel_path) < length(?2) " |
| 3196 | " AND substr(?2, 1, length(rel_path)) = rel_path " |
| 3197 | " AND substr(?2, length(rel_path) + 1, 1) = '/')) " |
| 3198 | "ORDER BY rel_path, kind;"; |
| 3199 | return coverage_query_rows(s, project, scope, sql, out, count); |
| 3200 | } |
| 3201 | |
| 3202 | void cbm_store_coverage_meta_clear(cbm_coverage_meta_t *meta) { |
| 3203 | if (!meta) { |
no test coverage detected