From cd74fd80476f0acf8147283d09f8b6ca02512c03 Mon Sep 17 00:00:00 2001 From: achamayou Date: Tue, 1 Sep 2026 21:16:56 +0100 Subject: [PATCH] Exclude tests from coverage reports Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- scripts/coverage.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 58d7285009dc..15d54172a8a4 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -164,8 +164,9 @@ build_cov_args() { for bin in "${BINARIES[@]:1}"; do args+=("-object" "${bin}") done - # Exclude third-party code from all reports - args+=("-ignore-filename-regex=3rdparty/") + # Exclude third-party and test code: coverage should measure the framework + # being tested, not the tests exercising it. + args+=("-ignore-filename-regex=3rdparty/|/test/|/tests/|_test\.(cpp|h)$|/perf/") # Override compilation directory so llvm-cov can resolve mapped source paths if [[ -n "${COMPILATION_DIR}" ]]; then args+=("-compilation-dir=${COMPILATION_DIR}")