Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:ClickHouse ClickHouse Coverage

From Leeroopedia
Revision as of 14:37, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/ClickHouse_ClickHouse_Coverage.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Testing, Instrumentation
Last Updated 2026-02-08 00:00 GMT

Overview

Code coverage instrumentation that collects execution data for test analysis.

Description

Implements custom coverage collection using LLVM sanitizer callbacks. Maintains arrays of executed addresses and provides APIs to retrieve current and cumulative coverage.

Usage

Use for measuring test coverage, implementing coverage-guided fuzzing, or analyzing code execution patterns.

Code Reference

Source Location

Signature

void dumpCoverageReportIfPossible();

#if defined(SANITIZE_COVERAGE)
std::span<const uintptr_t> getCurrentCoverage();
std::span<const uintptr_t> getCumulativeCoverage();
std::span<const uintptr_t> getAllInstrumentedAddresses();
void resetCoverage();
#endif

Import

#include <base/coverage.h>

Usage Examples

#include <base/coverage.h>

// Reset coverage counters before test
resetCoverage();

// Run test code
run_test();

// Get coverage data
auto coverage = getCurrentCoverage();
for (uintptr_t addr : coverage) {
    // Process covered address
}

// Dump coverage report
dumpCoverageReportIfPossible();

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment