mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
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:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <helper/Devices.h>
|
||||
#include <helper/Transport.h>
|
||||
#include <helper/TransportParam.h>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -19,8 +20,9 @@ namespace
|
||||
using namespace std;
|
||||
using namespace fair::mq::test;
|
||||
|
||||
auto RunPoller(string const& transport, int pollType) -> void
|
||||
auto RunPoller(TransportParam const& param, int pollType) -> void
|
||||
{
|
||||
auto const& transport = param.transport;
|
||||
IpcAddress const data1("poller_data1");
|
||||
IpcAddress const data2("poller_data2");
|
||||
|
||||
@@ -30,31 +32,25 @@ auto RunPoller(string const& transport, int pollType) -> void
|
||||
{"pollin_" + transport, "name=data1,type=pull,method=connect,address=" + data1.str()
|
||||
+ " name=data2,type=pull,method=connect,address=" + data2.str(),
|
||||
"--poll-type " + to_string(pollType)},
|
||||
}, RunOptions(transport));
|
||||
}, RunOptions(transport, param.DeviceArgs()));
|
||||
|
||||
for (auto const& result : results) {
|
||||
EXPECT_TRUE(Succeeded(result, transport));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Subchannel, zeromq)
|
||||
using Poller = TransportTest;
|
||||
|
||||
TEST_P(Poller, Subchannel)
|
||||
{
|
||||
RunPoller("zeromq", 0);
|
||||
RunPoller(GetParam(), 0);
|
||||
}
|
||||
|
||||
TEST(Subchannel, shmem)
|
||||
TEST_P(Poller, Channel)
|
||||
{
|
||||
RunPoller("shmem", 0);
|
||||
RunPoller(GetParam(), 1);
|
||||
}
|
||||
|
||||
TEST(Channel, zeromq)
|
||||
{
|
||||
RunPoller("zeromq", 1);
|
||||
}
|
||||
|
||||
TEST(Channel, shmem)
|
||||
{
|
||||
RunPoller("shmem", 1);
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P(, Poller, AllTransports(), TransportParamName());
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user