From fe7d23a7e0201e6c6ec6e16c6975140c524a2cbe Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:11:08 +0300 Subject: [PATCH] coverage: score_coverage 0.4.2 and unoptimised baseline notes 0.4.2 lists the own sources of a cc_binary (launch_manager's main.cpp) at 0 % instead of under no-data in unmapped_files.txt, and renders baseline-only files in their own HTML run so an executable's main cannot pick up a test binary's counts (coverage_tool#40). The gcov config gets --host_cxxopt=-O0: the scope's baseline .gcno notes of untested files are built in the exec configuration with the host options; without it GCC optimises them and their line tables differ from the -O0 test builds (user manual step 4b). Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- MODULE.bazel | 2 +- MODULE.bazel.lock | 4 ++-- quality/coverage/coverage.bazelrc | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index b49b2fb0dc..3cf720e145 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -41,7 +41,7 @@ bazel_dep(name = "score_tooling", version = "2.2.1") bazel_dep(name = "score_rust_policies", version = "0.0.5", dev_dependency = True) bazel_dep(name = "score_cpp_policies", version = "0.1.1", dev_dependency = True) bazel_dep(name = "score_devcontainer", version = "1.11.2", dev_dependency = True) -bazel_dep(name = "score_coverage", version = "0.4.1", dev_dependency = True) +bazel_dep(name = "score_coverage", version = "0.4.2", dev_dependency = True) bazel_dep(name = "score_process_description", version = "2.1.2") bazel_dep(name = "score_platform", version = "0.7.3") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 78db79a481..088dd8f3f1 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1187,8 +1187,8 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_bazel_platforms/1.1.0/source.json": "9797d56e9dd68e9d3e8b674402df2d6d5e2174f84184ca4cbee78fc07dc117d9", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.5.0/MODULE.bazel": "7f6981dfb8b87466a3bcf009bf92cb7ba54ae0398a9af729010cee452858bf70", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.5.0/source.json": "7bfd189a39bf79891a17e0ab81144f5d4f51df3c6f5517eec3b0a11edb960b0d", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.4.1/MODULE.bazel": "6950d8aea5c4fccad35442993fd112dc989279a6107f558dcdfd9d2b053318fe", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.4.1/source.json": "7718fb4dba4360dbd15deb5a0e741f9167294d8c90671a1d408463446c6c1da2", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.4.2/MODULE.bazel": "32ad2d21a7f0e62b2a7367c67623c69be72cf3fb80561560c1ec95cd59d00160", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.4.2/source.json": "e46af7a986d5e85fa557491994fb9ab630323810e1d7605cdccb70bcd9c3b8aa", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cpp_policies/0.1.1/MODULE.bazel": "62968745a2fe77c449d4e11447b50918c58f870eeac72f0f3198c63617a2f8a2", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cpp_policies/0.1.1/source.json": "29d45fbd6f3fae0a21487f5d652dfa0796bd2095d2a19732a5456e5b232754a9", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.2.2/MODULE.bazel": "dc36d9c35543db918c3fb5b93a8e684431f56c7c784cf2a1b90f35802a373c98", diff --git a/quality/coverage/coverage.bazelrc b/quality/coverage/coverage.bazelrc index f31c3691ac..cc34b4f8ac 100644 --- a/quality/coverage/coverage.bazelrc +++ b/quality/coverage/coverage.bazelrc @@ -97,6 +97,10 @@ coverage:gcov --nocache_test_results # compiled with instrumentation through an instrumented dependency. coverage:gcov --instrumentation_filter=^//score[/:] coverage:gcov --cxxopt=-O0 +# The scope's baseline .gcno notes of untested files are built in the exec +# configuration and take the HOST options; without this GCC optimises them and +# their line tables differ from the -O0 test builds (coverage_tool#44). +coverage:gcov --host_cxxopt=-O0 coverage:gcov --combined_report=lcov coverage:gcov --dynamic_mode=off coverage:gcov --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix