Files
FairMQ/test/protocols/_pub_sub.cxx
Claude 6a55bf1d55 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>
2026-11-03 17:00:01 +01:00

49 lines
1.8 KiB
C++

/********************************************************************************
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include <helper/Devices.h>
#include <helper/Transport.h>
#include <helper/TransportParam.h>
#include <gtest/gtest.h>
#include <string>
namespace
{
using namespace std;
using namespace fair::mq::test;
using PubSub = TransportTest;
TEST_P(PubSub, MultiThreaded_ipc)
{
auto const& transport = GetParam().transport;
IpcAddress const data("pub_sub_data");
IpcAddress const control("pub_sub_control");
auto const subChannels = "name=data,type=sub,method=connect,address=" + data.str()
+ " name=control,type=push,method=connect,address=" + control.str();
auto const results = RunDevices({
{"pub_" + transport, "name=data,type=pub,method=bind,address=" + data.str()
+ " name=control,type=pull,method=bind,address=" + control.str()},
{"sub_1_" + transport, subChannels},
{"sub_2_" + transport, subChannels},
}, RunOptions(transport, GetParam().DeviceArgs()));
for (auto const& result : results) {
EXPECT_TRUE(Succeeded(result, transport));
}
}
// The shmem transport does not support pub/sub.
INSTANTIATE_TEST_SUITE_P(, PubSub, testing::Values(TransportParam("zeromq")), TransportParamName());
} // namespace