You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That PR introduces src/test_helpers/ as the home for test helpers shared across the test and benchmark binaries (starting with TempDir.h, moved out of include/xrpl/beast/utility/temp_dir.h). TestSink should be moved there as well.
Current state
TestSink lives in the gtest-only helper directory:
src/tests/libxrpl/helpers/TestSink.h
src/tests/libxrpl/helpers/TestSink.cpp
and is included as <helpers/TestSink.h> by, among others:
src/tests/libxrpl/basics/KeyCache.cpp
src/tests/libxrpl/basics/TaggedCache.cpp
src/tests/libxrpl/consensus/Consensus.cpp
src/tests/libxrpl/net/HTTPClient.cpp
src/tests/libxrpl/nodestore/Database.cpp
src/tests/libxrpl/peerfinder/Livecache.cpp
src/tests/libxrpl/shamap/SHAMap.cpp
Because it sits under src/tests/libxrpl/helpers, it is only reachable from the xrpl_tests target, so the older src/test suites cannot use it.
Proposed change
Move TestSink.h/TestSink.cpp to src/test_helpers/.
Update the includes to <test_helpers/TestSink.h> and adjust the xrpl_tests source list in src/tests/libxrpl/CMakeLists.txt.
Summary
Follow-up to a review comment on #7012: #7012 (comment)
That PR introduces
src/test_helpers/as the home for test helpers shared across the test and benchmark binaries (starting withTempDir.h, moved out ofinclude/xrpl/beast/utility/temp_dir.h).TestSinkshould be moved there as well.Current state
TestSinklives in the gtest-only helper directory:src/tests/libxrpl/helpers/TestSink.hsrc/tests/libxrpl/helpers/TestSink.cppand is included as
<helpers/TestSink.h>by, among others:src/tests/libxrpl/basics/KeyCache.cppsrc/tests/libxrpl/basics/TaggedCache.cppsrc/tests/libxrpl/consensus/Consensus.cppsrc/tests/libxrpl/net/HTTPClient.cppsrc/tests/libxrpl/nodestore/Database.cppsrc/tests/libxrpl/peerfinder/Livecache.cppsrc/tests/libxrpl/shamap/SHAMap.cppBecause it sits under
src/tests/libxrpl/helpers, it is only reachable from thexrpl_teststarget, so the oldersrc/testsuites cannot use it.Proposed change
TestSink.h/TestSink.cpptosrc/test_helpers/.<test_helpers/TestSink.h>and adjust thexrpl_testssource list insrc/tests/libxrpl/CMakeLists.txt.isolate_headers/include wiring added in refactor: Replaceboost::filesystemwithstd::filesystemacross the codebase #7012 exposes it to the other test and benchmark targets that need it.Optional cleanup
There are two unrelated, locally-defined
TestSinkclasses that could be consolidated onto the shared one once it is generally reachable:src/test/beast/beast_Journal_test.cpp:11src/test/server/Server_test.cpp:79Note these have different semantics (severity threshold, suite-reporting), so consolidation may not be a straight substitution.
Blocked on
#7012 landing first, since
src/test_helpers/does not exist ondevelopyet.