test: parameterize the protocol, poller and transfer tests by transport

- Add test::TransportParam with the transport, the expanded shm metadata
  flag and a name generator for INSTANTIATE_TEST_SUITE_P()
- Turn the per-transport TEST() copies into TEST_P() suites; the poller
  and transfer tests now also run with the expanded shm metadata
- Name the multipart suite PushPullMultipart (it shared PushPull)
- Discover the tests with NO_PRETTY_VALUES, so the ctest names are
  Suite.Case/transport
- The test names change, e.g. Pair.SingleMsg_MultiThreaded_ipc_shmem
  is now Pair.SingleMsg_MultiThreaded_ipc/shmem

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 14:40:28 +00:00
committed by Dennis Klein
parent 2a57a38efe
commit 6a55bf1d55
9 changed files with 154 additions and 155 deletions

View File

@@ -8,6 +8,7 @@
#include <helper/Devices.h>
#include <helper/Transport.h>
#include <helper/TransportParam.h>
#include <gtest/gtest.h>
@@ -19,34 +20,24 @@ namespace
using namespace std;
using namespace fair::mq::test;
auto RunReqRep(string const& transport, string const& extraArgs) -> void
using ReqRep = TransportTest;
TEST_P(ReqRep, MultiThreaded_ipc)
{
auto const& transport = GetParam().transport;
IpcAddress const address("req_rep");
auto const results = RunDevices({
{"rep_" + transport, "name=data,type=rep,method=bind,address=" + address.str()},
{"req_1_" + transport, "name=data,type=req,method=connect,address=" + address.str()},
{"req_2_" + transport, "name=data,type=req,method=connect,address=" + address.str()},
}, RunOptions(transport, extraArgs));
}, RunOptions(transport, GetParam().DeviceArgs()));
for (auto const& result : results) {
EXPECT_TRUE(Succeeded(result, transport));
}
}
TEST(ReqRep, zeromq)
{
RunReqRep("zeromq", "");
}
TEST(ReqRep, shmem)
{
RunReqRep("shmem", "");
}
TEST(ReqRep, shmem_expanded_metadata)
{
RunReqRep("shmem", "--shm-metadata-msg-size 2048");
}
INSTANTIATE_TEST_SUITE_P(, ReqRep, AllTransports(), TransportParamName());
} // namespace