test: Replace gtest assertions in the fixture runners - #1673
Merged
Conversation
Contributor
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1673 +/- ##
==========================================
- Coverage 97.72% 97.56% -0.16%
==========================================
Files 171 174 +3
Lines 15666 15876 +210
Branches 3625 3646 +21
==========================================
+ Hits 15310 15490 +180
- Misses 269 289 +20
- Partials 87 97 +10
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
8 times, most recently
from
August 25, 2026 21:42
d321037 to
5fb5731
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 26, 2026 08:23
229e536 to
4e2da50
Compare
| /// Records that @p what did not hold. | ||
| void fail(std::string_view what, std::string detail = {}) | ||
| { | ||
| m_sink(Failure{m_test, m_where, std::string{what}, std::move(detail)}); |
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 unrelated jobs: registering anddriving the tests, and an assertion vocabulary inside the runners. This replaces the second with
TestReport, which the runners take by reference and record into:start_case()names thefixture's test,
at()the place within it,check()/check_eq()what is compared,fail()whatdid not hold. There are no macros, so the report is a parameter rather than a global and a check
is named in the fixture's own terms instead of by a stringified expression. Each failure reaches
the driver's sink as it is recorded, where a small bridge turns it into a gtest failure; the
bridge goes away with the driver.
Behaviour is unchanged: every former
ASSERT_*became an explicitreturnwith the same scope,every
EXPECT_*a non-returning check. A green fixture run reaches none of this code, so thepolarity of all 40 sites was checked against the original rather than inferred from passing
suites.