test: Replace gtest assertions in the fixture runners - #1673
Open
chfast wants to merge 1 commit into
Open
Conversation
Contributor
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1673 +/- ##
==========================================
- Coverage 97.72% 97.52% -0.21%
==========================================
Files 171 174 +3
Lines 15666 15860 +194
Branches 3625 3641 +16
==========================================
+ Hits 15310 15467 +157
- Misses 269 295 +26
- Partials 87 98 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
chfast
force-pushed
the
test/report-without-gtest
branch
6 times, most recently
from
August 24, 2026 18:20
e44c90b to
81fad7d
Compare
There was a problem hiding this comment.
Pull request overview
Replaces GoogleTest assertions inside fixture runners with structured TestReport failure collection while retaining GoogleTest as the test driver.
Changes:
- Adds scoped, structured failure reporting and rendering.
- Migrates state and blockchain runners to explicit checks and failures.
- Bridges collected failures to GoogleTest and adds unit coverage.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/utils/test_report.hpp |
Defines reporting API and failure model. |
test/utils/test_report.cpp |
Formats structured failures. |
test/utils/statetest.hpp |
Adds report parameter to state runner. |
test/utils/CMakeLists.txt |
Builds reporting utilities. |
test/unittests/test_report_test.cpp |
Tests reporting and rendering. |
test/unittests/CMakeLists.txt |
Registers report tests. |
test/statetest/statetest.cpp |
Bridges state-test reports to GoogleTest. |
test/statetest/statetest_runner.cpp |
Replaces runner assertions with report checks. |
test/blockchaintest/blockchaintest.cpp |
Bridges blockchain reports to GoogleTest. |
test/blockchaintest/blockchaintest_runner.hpp |
Adds report parameter to blockchain runner. |
test/blockchaintest/blockchaintest_runner.cpp |
Migrates blockchain assertions to reporting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chfast
force-pushed
the
test/report-without-gtest
branch
3 times, most recently
from
August 25, 2026 15:22
22c8f79 to
231ca83
Compare
The state and blockchain test runners used gtest only as an assertion
vocabulary. Replace it with TestReport, which the runners take by
reference and record into: start_case() names the fixture's test, at()
the place within it, check()/check_eq() what is compared, fail() what did
not hold. The binaries still drive the tests, passing a sink that turns
each failure into a gtest one as it is recorded, so a run that dies
part-way still reports what it found. A failure is reported the way
pytest reports one:
<test name>:
Prague/0:
state root:
actual 0x5f8c...
expected 0x9e21...
No macros, so no global report to reach from one and no stringified
expressions: a check is named in the fixture's terms instead. Detail too
expensive to format unless a check fails is passed as a callable, run
before the failure is recorded so that the sink sees it whole; one site
dumps the entire result state that way.
chfast
force-pushed
the
test/report-without-gtest
branch
from
August 25, 2026 15:55
231ca83 to
20f7340
Compare
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.
evmone-statetestandevmone-blockchaintestuse gtest for two unrelatedjobs: as a test registration/reporting framework, and as an assertion
vocabulary inside the runners. This is the first step of removing it,
covering only the second job.
TestReportreplaces the assertions. The runners take it by reference andrecord into it:
A failure is reported the way pytest reports one, nested and name-first:
The binaries still drive the tests; a small bridge turns the collected
failures into gtest failures and goes away with the driver.
Notes
There are no macros.
std::source_locationis not needed because thecheck names what it compares in the fixture's own terms, which locates it
better than a C++ line does; and detail built inside the failing branch is
as lazy as the streamed gtest messages were, which matters because one
site formats the whole result state and another reads the error of a
variant that holds one only when the check fails. Without macros the
report is a parameter rather than a global, so nothing prevents running
cases concurrently later.
Behaviour is unchanged. Every former
ASSERT_*became an explicitreturnwith the same scope, and everyEXPECT_*a non-returning check.A green fixture run does not exercise any of this, so the polarity of all
40 sites was reviewed against the original rather than inferred from the
suites passing.
One gtest behaviour is deliberately not preserved: failures are collected
and reported when the test ends instead of printed as they fire, so a run
that is killed loses the failures of the test in flight. The window is one
JSON file, and pytest buffers the same way.
Testing
ctest1221/1221. Against EESTtests@v20.0.1: state tests 8172/8172,blockchain tests 8612 passed with the same 6 skipped as before. Instruction
counts are unchanged (343.25 G vs 343.39 G on the state suite).