Skip to content

scope: build the coverage scope in the tests' configuration (QNX baseline) - #68

Draft
LittleHuba wants to merge 1 commit into
mainfrom
qnx_baseline_target_platform
Draft

LittleHuba wants to merge 1 commit into
mainfrom
qnx_baseline_target_platform

Conversation

@LittleHuba

@LittleHuba LittleHuba commented Nov 16, 2026 •

Copy link
Copy Markdown

Problem

Bazel analyses --coverage_report_generator in the exec configuration. A scope the reporter depends on is analysed there too, so every select() on the platform resolves for the host. On a QNX run the 0 % baseline listed Linux-only files and missed QNX-only ones (see #23).

Change

  • coverage_scope is an ordinary target, built in the same bazel coverage invocation as the tests, so it is analysed for the tests' platform. The platform attribute and the transition are removed.
  • score_coverage_reporter takes the scope label as a string rather than a dependency.
  • The reporters read .gcno files and sources from the bin directory of that configuration (scope_root) instead of their runfiles.
  • Scope outputs include gcno and source files in DefaultInfo.

Usage

bazel coverage --config=qnx <tests> //path:coverage_scope. --build_tests_only skips the scope and must not be used.

Testing

Bazel analyses --coverage_report_generator, and with it a scope it
depends on, in the exec configuration. Every select() on the platform
then resolved for the host, so a QNX run listed the Linux variants of
platform-specific code at 0 % and missed the QNX variants.

The scope is now an ordinary target built in the same invocation as the
tests, so it is analysed for the platform they run on. The reporter
reads the outputs from the bin directory of that configuration
(scope_root) instead of its own runfiles. The platform attribute and
the transition are removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ulrich Huber <ulrich.uh.huber@bmw.de>
@LittleHuba
LittleHuba force-pushed the qnx_baseline_target_platform branch from 04652ee to 7ff03b4 Compare November 16, 2026 16:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant