Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
test:clang-tidy --copt=-Wno-unused-command-line-argument

# Unified LLVM source-based coverage (C++ + Rust), see quality/coverage/ and
# @score_tooling//coverage. Use: bazel coverage --config=llvm_cov //score/... --build_tests_only
# @score_coverage. Use: bazel coverage --config=llvm_cov //score/... --build_tests_only
import %workspace%/quality/coverage/coverage.bazelrc
4 changes: 2 additions & 2 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

# Unified LLVM source-based coverage (C++ + Rust) from @score_tooling//coverage,
# Unified LLVM source-based coverage (C++ + Rust) from @score_coverage,
# see quality/coverage/. Integration tests need docker/QNX and are excluded via
# the llvm_cov config's test tag filter.
- name: Run coverage
Expand All @@ -63,7 +63,7 @@ jobs:
COVERAGE_THRESHOLD: "0"
run: |
set -euo pipefail
bazel run --lockfile_mode=error @score_tooling//coverage:generate_coverage_html -- \
bazel run --lockfile_mode=error @score_coverage//:generate_coverage_html -- \
--testlogs-subdir score \
--archive-dir coverage_artifact

Expand Down
11 changes: 8 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module(
# Bazel global rules
bazel_dep(name = "rules_python", version = "1.8.5")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_rust", version = "0.68.1-score")
bazel_dep(name = "rules_rust", version = "0.68.2-score")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "aspect_rules_lint", version = "2.5.0")

Expand All @@ -38,6 +38,11 @@ bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "score_bazel_platforms", version = "1.1.0")
bazel_dep(name = "score_docs_as_code", version = "8.2.0")
bazel_dep(name = "score_tooling", version = "2.2.0")

# LLVM source-based coverage pipeline (C++ + Rust): the qualified S-CORE
# coverage tool, successor of @score_tooling//coverage. See quality/coverage/.
bazel_dep(name = "score_coverage", version = "0.3.1", dev_dependency = True)

bazel_dep(name = "score_rust_policies", version = "0.0.5")
bazel_dep(name = "score_process_description", version = "2.1.2")
bazel_dep(name = "score_platform", version = "0.7.2")
Expand Down Expand Up @@ -151,13 +156,13 @@ llvm.toolchain(
)

# Coverage-only Clang instance (covmap instrumentation for the LLVM coverage
# pipeline from @score_tooling//coverage; active only under --config=llvm_cov).
# pipeline from @score_coverage; active only under --config=llvm_cov).
# Separate from the 19.1.7 instance above so clang-tidy behavior is untouched.
llvm.toolchain(
name = "llvm_toolchain_coverage",
cxx_standard = {"": "c++17"},
extra_known_features = [
"@score_tooling//coverage:enable_llvm_coverage_for_death_tests",
"@score_coverage//:enable_llvm_coverage_for_death_tests",
],
link_libs = {"": [
"-lrt",
Expand Down
2 changes: 2 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions quality/coverage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@score_tooling//coverage:defs.bzl", "score_coverage_reporter", "score_coverage_scope")
load("@score_coverage//:defs.bzl", "score_coverage_reporter", "score_coverage_scope")

# The production components of this module — the same scope the previous gcov
# configuration expressed as an instrumentation filter (//score/datarouter,
Expand All @@ -23,7 +23,7 @@ load("@score_tooling//coverage:defs.bzl", "score_coverage_reporter", "score_cove
#
# KNOWN GAP: the cc_binary entry-point sources of //score/datarouter:datarouter
# (main) are not collected — cc_binary provides no CcInfo for the scope aspect;
# its library deps are. Tracked as a scope-aspect enhancement in score_tooling.
# its library deps are. Tracked as a scope-aspect enhancement in score_coverage.
score_coverage_scope(
name = "coverage_scope",
testonly = True,
Expand Down
10 changes: 8 additions & 2 deletions quality/coverage/coverage.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

# ============================================================================
# LLVM source-based coverage (Linux, Clang covmap + Ferrocene) — C++ and Rust
# Pipeline: @score_tooling//coverage (see its README.md for the guide).
# Pipeline: @score_coverage (the qualified S-CORE coverage tool), guide:
# https://eclipse-score.github.io/coverage_tool/main/manual/user_manual.html
# Use with: bazel coverage --config=llvm_cov //score/... --build_tests_only
#
# Do NOT combine with --config=x86_64-linux: it registers the GCC toolchain,
Expand All @@ -22,6 +23,11 @@
# ============================================================================

coverage:llvm_cov --nocache_test_results
# Instrument everything under //score. Left unset, Bazel guesses the filter
# from the packages of the test targets (stripping only a trailing "/tests");
# a library tested from a "test" subpackage is then compiled without counters
# unless one of its deps happens to be instrumented (score_coverage 0.3.1).
coverage:llvm_cov --instrumentation_filter=^//score[/:]
coverage:llvm_cov --cxxopt=-O0
coverage:llvm_cov --combined_report=lcov
coverage:llvm_cov --experimental_fetch_all_coverage_outputs
Expand All @@ -42,7 +48,7 @@ coverage:llvm_cov --extra_toolchains=@llvm_toolchain_coverage//:cc-toolchain-x86
# so it is registered here explicitly.
coverage:llvm_cov --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu

coverage:llvm_cov --coverage_output_generator=@score_tooling//coverage:merger
coverage:llvm_cov --coverage_output_generator=@score_coverage//:merger
coverage:llvm_cov --coverage_report_generator=//quality/coverage:reporter_wrapper

# Keep raw profraw files; the merger handles profraw -> profdata directly.
Expand Down
Loading