Skip to content
Closed
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
18 changes: 14 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ jobs:
flags: runtime
disable_search: true

# Compile-time trap probing of the consteval code in protocol.hh: one
# -fsyntax-only compile per probe point, see scripts/consteval_coverage.py.
# Compile-time trap probing of the consteval code in the protocol headers:
# one -fsyntax-only compile per probe point, see
# scripts/consteval_coverage.py.
consteval-coverage:
name: consteval coverage
runs-on: ubuntu-26.04
timeout-minutes: 90
timeout-minutes: 30
strategy:
matrix:
shard: [0, 1, 2, 3]
permissions:
id-token: write # Tokenless Codecov upload via OIDC.
steps:
Expand All @@ -94,7 +98,13 @@ jobs:
- name: Build (provides the googletest headers)
run: ./scripts/cmake.sh build -B coverage
- name: Probe consteval coverage
run: ./scripts/consteval_coverage.sh --lcov-output build/consteval-coverage/coverage.info
# Probe points, not whole headers, are split across the matrix:
# header sizes are too uneven (name_mangling.h alone is nearly two
# fifths of them) for whole-header shards to balance the load.
run: |
./scripts/consteval_coverage.sh \
--shard-count 4 --shard-index ${{ matrix.shard }} \
--lcov-output build/consteval-coverage/coverage.info
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ Consteval coverage is instead measured by compile-time trap probing:
./scripts/consteval_coverage.sh
```

The tool instruments a copy of `protocol.hh` with trap calls at every block
entry and `return`/`throw` statement in consteval code, then recompiles the
The tool instruments a copy of each header that carries consteval machinery
for `protocol`/`protocol_view` with trap calls at every block entry and
`return`/`throw` statement in consteval code, then recompiles the
protocol-instantiating test translation units once per trap with
`-fsyntax-only`, arming one trap at a time; a compile failure proves the
test suite evaluated that line, because a constant evaluation has no other
Expand Down
Loading
Loading