Require the instrumentation filter; warn when it was left to Bazel - #12
Merged
Merged
Conversation
baselibs' first QNX report showed score/os at 13 % against 80 % on Linux although the tests had run. Bazel guesses --instrumentation_filter from the packages of the test targets and strips only a trailing /tests; libraries tested from a "test" subpackage are outside the guess. On the gcov backend Bazel's collector then drops their counters; on both backends a library without an instrumented direct dependency is compiled without counters at all. - User manual: --instrumentation_filter=^//<root>[/:] is part of the LLVM config (step 4) and required for the gcov config (step 4b). Architecture and known problems corrected: the filter is not irrelevant, it must name the module. - Both reporters warn when in-scope files without test data sit in a directory that is tested from a test/ or tests/ subdirectory and name the flag (tool_req__coverage_instrumentation_hint, ERR-13). - Integration workspace: //lib:cross_pkg tested from //lib/test, in both goldens; both configs set the filter; a gcov run with the guessed filter checks the warning. With the filter the vendored external header is measured on gcov too; golden and docs corrected. - Release notes 0.3.1; 0.3.0 dated. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
dcalavrezo-qorix
requested review from
AlexanderLanin,
MaximilianSoerenPollak and
nradakovic
as code owners
September 29, 2026 13:30
Contributor
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
MaximilianSoerenPollak
previously approved these changes
Sep 29, 2026
The label precedes a paragraph, not a heading, so the bare :ref: had no caption and the docs job (warnings as errors) failed. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
MaximilianSoerenPollak
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
baselibs' first QNX report (eclipse-score/baselibs#626) showed
score/osat 13 % line coverage against 80 % on Linux, although the tests had run on the target. Cause: Bazel computes the default--instrumentation_filterfrom the packages of the test targets and strips only a trailing/tests(InstrumentationFilterSupport.java). baselibs testsscore/osfromscore/os/test, so the guessed filter contains^//score/os/test[/:]and notscore/os.Consequences, reproduced in the integration workspace:
no-data. The 0.3.0 docs claimed the filter has no effect; that was true only by the accident of dependencies.What
--instrumentation_filter=^//<root>[/:]added to step 4 (LLVM config) and required in step 4b (gcov config), with the explanation. Architecture design decision and the known-problems row corrected.test/ortests/subdirectory, and name the flag. Newtool_req__coverage_instrumentation_hint, potential error ERR-13 (under-reporting, detected). Two unit tests.//lib:cross_pkg, a dependency-free library tested from//lib/test(the baselibs layout), in both goldens with hand-derived numbers. Both configs set the filter. A gcov run with Bazel's guessed filter checks that the file falls to 0 % and that the reporter prints the hint.Verification
bazel test //score_coverage/tests/... //tools:allintegration_tests/run_integration_test.shbazel build --config=lint //score_coverage/...,bazel run //tools:format.checkbazel run //docs:docs_checkConsumer side: the one-line fix is already on baselibs#626 and communication#1171 (QNX configs); logging#338 and lifecycle#715 get the LLVM line as a follow-up commit.