diff --git a/.github/ci/after_make.sh b/.github/ci/after_make.sh index d094d879..802b0d63 100644 --- a/.github/ci/after_make.sh +++ b/.github/ci/after_make.sh @@ -1,2 +1,2 @@ # It's necessary to install the python modules for the test. -make install \ No newline at end of file +make install diff --git a/.github/ci/before_cmake.sh b/.github/ci/before_cmake.sh index 93cb2ae6..e36310c6 100644 --- a/.github/ci/before_cmake.sh +++ b/.github/ci/before_cmake.sh @@ -1,2 +1,4 @@ -# Set ROS_DISTRO. This is needed for finding zenoh packages vendored by ROS 2 +# Instead of sourcing ros setup script, set only required env variables. +# This is needed for finding zenoh packages vendored by ROS 2. export ROS_DISTRO="jazzy" +export LD_LIBRARY_PATH="/opt/ros/${ROS_DISTRO}/opt/zenoh_cpp_vendor/lib:$LD_LIBRARY_PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b7ca67a..100f14ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,3 +23,14 @@ jobs: cppcheck-enabled: true cpplint-enabled: true doxygen-enabled: true + noble-ci-zenoh: + runs-on: ubuntu-latest + name: Ubuntu Noble CI - Zenoh + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Compile and test + id: ci + uses: gazebo-tooling/action-gz-ci@noble + with: + cmake-args: '-DGZ_TRANSPORT_DEFAULT_IMPLEMENTATION=zenoh' diff --git a/CMakeLists.txt b/CMakeLists.txt index 8561435b..ab42c398 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ gz_find_package(GzProtobuf #-------------------------------------- # Find ZeroMQ gz_find_package(ZeroMQ VERSION 4 REQUIRED PRIVATE) +list(APPEND GZ_TRANSPORT_IMPLEMENTATION_LIST "zeromq") if (UNIX AND NOT APPLE) execute_process(COMMAND lsb_release -cs @@ -97,8 +98,8 @@ gz_find_package(CPPZMQ REQUIRED PRIVATE ######################################## # Find Zenoh -gz_find_package(zenohc PRIVATE) -gz_find_package(zenohcxx PRIVATE) +gz_find_package(zenohc PRIVATE QUIET) +gz_find_package(zenohcxx PRIVATE QUIET) # If both zenohc and zenohcpp packages are not found then # look for these pacakages installed by ROS 2 zenoh_cpp_vendor package @@ -108,8 +109,8 @@ if (NOT zenohc_FOUND AND NOT zenohcxx_FOUND) set(ros2_zenoh_cmake_path "/opt/ros/$ENV{ROS_DISTRO}/opt/zenoh_cpp_vendor/lib/cmake") if (EXISTS ${ros2_zenoh_cmake_path}) list(PREPEND CMAKE_PREFIX_PATH ${ros2_zenoh_cmake_path}) - find_package(zenohc QUIET) - find_package(zenohcxx QUIET) + gz_find_package(zenohc PRIVATE QUIET) + gz_find_package(zenohcxx PRIVATE QUIET) endif() endif () @@ -123,6 +124,7 @@ else () message (STATUS "Looking for zenohcxx and zenohc - found") set (HAVE_ZENOH ON CACHE BOOL "HAVE ZENOH" FORCE) list(APPEND EXTRA_TEST_LIB_DEPS "zenohcxx::zenohc") + list(APPEND GZ_TRANSPORT_IMPLEMENTATION_LIST "zenoh") endif () #-------------------------------------- @@ -168,6 +170,13 @@ gz_find_package(SQLite3 PRIVATE_FOR log PRETTY sqlite3) +#-------------------------------------- +# Check GZ_TRANSPORT_DEFAULT_IMPLEMENTATION value +set(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION "zeromq" CACHE + STRING "Set default gz-transport implementation") +if (NOT ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION} IN_LIST GZ_TRANSPORT_IMPLEMENTATION_LIST) + message(FATAL_ERROR "Invalid GZ_TRANSPORT_DEFAULT_IMPLEMENTATION value: ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}") +endif() #============================================================================ # Configure the build diff --git a/include/gz/transport/Helpers.hh b/include/gz/transport/Helpers.hh index feff06b1..99af5b04 100644 --- a/include/gz/transport/Helpers.hh +++ b/include/gz/transport/Helpers.hh @@ -72,6 +72,10 @@ namespace gz /// \returns id of current process unsigned int GZ_TRANSPORT_VISIBLE getProcessId(); + /// \brief Get the name of the underlying transport implementation + /// \returns Name of the transport implementation, e.g. "zeromq", "zenoh" + std::string GZ_TRANSPORT_VISIBLE getTransportImplementation(); + // Use safer functions on Windows #ifdef _MSC_VER #define gz_strcat strcat_s diff --git a/include/gz/transport/config.hh.in b/include/gz/transport/config.hh.in index 97de3d9f..1bf9580a 100644 --- a/include/gz/transport/config.hh.in +++ b/include/gz/transport/config.hh.in @@ -35,5 +35,6 @@ #cmakedefine HAVE_IFADDRS 1 #cmakedefine UBUNTU_FOCAL 1 #cmakedefine HAVE_ZENOH 1 +#cmakedefine GZ_TRANSPORT_DEFAULT_IMPLEMENTATION "${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}" #endif diff --git a/log/src/LogCommandAPI_TEST.cc b/log/src/LogCommandAPI_TEST.cc index b07f1c34..24481b58 100644 --- a/log/src/LogCommandAPI_TEST.cc +++ b/log/src/LogCommandAPI_TEST.cc @@ -18,6 +18,8 @@ #include "cmd/LogCommandAPI.hh" #include "gtest/gtest.h" +#include "test_utils.hh" + ////////////////////////////////////////////////// TEST(LogCommandAPI, Version) { @@ -55,6 +57,7 @@ TEST(LogCommandAPI, PlaybackBadRemap) ////////////////////////////////////////////////// TEST(LogCommandAPI, RecordFailedToOpen) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") EXPECT_EQ(FAILED_TO_OPEN, recordTopics("!@#$%^&*(:;[{]})?/.'|", ".*")); } diff --git a/log/src/Recorder_TEST.cc b/log/src/Recorder_TEST.cc index c2bc2677..b7a65e79 100644 --- a/log/src/Recorder_TEST.cc +++ b/log/src/Recorder_TEST.cc @@ -21,6 +21,8 @@ #include "gz/transport/log/Recorder.hh" #include "gtest/gtest.h" +#include "test_utils.hh" + using namespace gz; ////////////////////////////////////////////////// @@ -85,6 +87,8 @@ TEST(Record, AddInvalidTopic) ////////////////////////////////////////////////// TEST(Record, AddTopicRegex) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::log::Recorder recorder; EXPECT_EQ(0, recorder.AddTopic(std::regex("////"))); } diff --git a/log/src/cmd/LogCommandAPI.cc b/log/src/cmd/LogCommandAPI.cc index 84ee4b5e..6ec517c7 100644 --- a/log/src/cmd/LogCommandAPI.cc +++ b/log/src/cmd/LogCommandAPI.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include "../Console.hh" @@ -60,8 +61,16 @@ int recordTopics(const char *_file, const char *_pattern) transport::log::Recorder recorder; - if (recorder.AddTopic(regexPattern) < 0) - return FAILED_TO_SUBSCRIBE; + // Recorder functionality is not working in zenoh implementation yet + // Continue executing the rest of this function for the gz_log_record_* ruby + // test. + // \todo(iche033) Remove this check once supported. + if (gz::transport::getTransportImplementation() != "zenoh") + { + LWRN("Recording is not supported in zenoh\n"); + if (recorder.AddTopic(regexPattern) < 0) + return FAILED_TO_SUBSCRIBE; + } if (recorder.Start(_file) != transport::log::RecorderError::SUCCESS) return FAILED_TO_OPEN; diff --git a/log/test/integration/playback.cc b/log/test/integration/playback.cc index 1d149585..cbbea8ff 100644 --- a/log/test/integration/playback.cc +++ b/log/test/integration/playback.cc @@ -102,6 +102,8 @@ bool ExpectSameMessages( /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLog)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -202,6 +204,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayNoSuchTopic)) /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -269,6 +273,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) /// that the playback matches the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -378,6 +384,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -448,6 +456,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) /// methods to control the playback flow. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -570,6 +580,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) /// the playback workflow. TEST(playback, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ReplayStep)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -686,6 +698,8 @@ TEST(playback, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ReplayStep)) /// the playback workflow. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplaySeek)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; diff --git a/log/test/integration/recorder.cc b/log/test/integration/recorder.cc index 2773d151..d3bf7571 100644 --- a/log/test/integration/recorder.cc +++ b/log/test/integration/recorder.cc @@ -76,6 +76,8 @@ void VerifyMessage(const gz::transport::log::Message &_msg, TEST(recorder, GZ_UTILS_TEST_DISABLED_ON_MAC(BeginRecordingTopicsBeforeAdvertisement)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -146,6 +148,8 @@ TEST(recorder, /// so we only test to see that we received the very last message. TEST(recorder, BeginRecordingTopicsAfterAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar"}; const std::string logName = @@ -272,12 +276,16 @@ void RecordPatternBeforeAdvertisement(const std::regex &_pattern) ////////////////////////////////////////////////// TEST(recorder, BeginRecordingPatternBeforeAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + RecordPatternBeforeAdvertisement(std::regex(".*foo.*")); } ////////////////////////////////////////////////// TEST(recorder, BeginRecordingAllBeforeAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + RecordPatternBeforeAdvertisement(std::regex(".*")); } @@ -287,6 +295,8 @@ TEST(recorder, BeginRecordingAllBeforeAdvertisement) /// data queue. TEST(recorder, DataWriterQueue) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -376,6 +386,8 @@ TEST(recorder, DataWriterQueue) /// Test that clock is properly recorded TEST(recorder, DataWriterQueueClockUpdates) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -517,6 +529,8 @@ void TestBufferSizeSettings(const std::optional &_bufferSize, /// Test default buffer size setting TEST(recorder, DataWriterQueueDefaultBufferSize) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(std::nullopt, 50); } @@ -524,6 +538,8 @@ TEST(recorder, DataWriterQueueDefaultBufferSize) /// Test infinite buffer size setting TEST(recorder, DataWriterQueueInfiniteBufferSize) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(0, 50); } @@ -532,6 +548,8 @@ TEST(recorder, DataWriterQueueInfiniteBufferSize) /// still get recorded TEST(recorder, DataWriterQueueLargeMessages) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(1, 1); } diff --git a/parameters/src/CMakeLists.txt b/parameters/src/CMakeLists.txt index 7ac13760..cce4d545 100644 --- a/parameters/src/CMakeLists.txt +++ b/parameters/src/CMakeLists.txt @@ -19,7 +19,7 @@ endif() gz_build_tests( TYPE "UNIT" SOURCES ${gtest_sources} - LIB_DEPS ${param_lib_target} ${EXTRA_TEST_LIB_DEPS} + LIB_DEPS ${param_lib_target} ${EXTRA_TEST_LIB_DEPS} test_config ) if(NOT WIN32) diff --git a/parameters/src/cmd/ParamCommandAPI_TEST.cc b/parameters/src/cmd/ParamCommandAPI_TEST.cc index 1881f800..6b694d24 100644 --- a/parameters/src/cmd/ParamCommandAPI_TEST.cc +++ b/parameters/src/cmd/ParamCommandAPI_TEST.cc @@ -26,6 +26,8 @@ #include "gtest/gtest.h" +#include "test_utils.hh" + using namespace gz; using namespace transport; using namespace transport::parameters; @@ -137,6 +139,7 @@ TEST_F(ParametersClientTest, cmdParameterGet) ////////////////////////////////////////////////// TEST_F(ParametersClientTest, SetParameter) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") { CaptureCoutScoped coutCapture; CaptureCerrScoped cerrCapture; @@ -187,6 +190,7 @@ TEST_F(ParametersClientTest, SetParameter) ////////////////////////////////////////////////// TEST_F(ParametersClientTest, ListParameters) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") { CaptureCoutScoped coutCapture; CaptureCerrScoped cerrCapture; diff --git a/python/src/transport/_gz_transport_pybind11.cc b/python/src/transport/_gz_transport_pybind11.cc index 0289f0fc..ed8f1179 100644 --- a/python/src/transport/_gz_transport_pybind11.cc +++ b/python/src/transport/_gz_transport_pybind11.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -68,7 +69,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { &AdvertiseMessageOptions::MsgsPerSec, &AdvertiseMessageOptions::SetMsgsPerSec, "The maximum number of messages per second to be published") - .def("__copy__", + .def("__copy__", [](const AdvertiseMessageOptions &self) { return AdvertiseMessageOptions(self); @@ -110,9 +111,9 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { }, py::arg("from_topic"), "Get a topic remapping. Returns a pair with the result of the method" - "and the remapped name of the topic. The topic name remains empty if" + "and the remapped name of the topic. The topic name remains empty if" "there isn't any remap for the topic") - .def("__copy__", + .def("__copy__", [](const NodeOptions &self) { return NodeOptions(self); @@ -135,7 +136,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { &SubscribeOptions::MsgsPerSec, &SubscribeOptions::SetMsgsPerSec, "Set the maximum number of messages per second received per topic") - .def("__copy__", + .def("__copy__", [](const SubscribeOptions &self) { return SubscribeOptions(self); @@ -304,7 +305,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { "Get the current statistics for a topic. Statistics must" "have been enabled using the EnableStats function, otherwise" "the return value will be null."); - + // Register Node::Publisher as a subclass of Node py::class_(node, "Publisher", "A class that is used to store information about an" @@ -323,6 +324,10 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { .def("has_connections", &gz::transport::Node::Publisher::HasConnections, "Return true if this publisher has subscribers"); + + m.def("transport_implementation", &getTransportImplementation, + "Get the name of the underlying transport implementation."); + } // gz-transport module } // python diff --git a/python/test/pubSub_TEST.py b/python/test/pubSub_TEST.py index 1857d540..7f823a06 100644 --- a/python/test/pubSub_TEST.py +++ b/python/test/pubSub_TEST.py @@ -16,7 +16,7 @@ from gz.msgs11.stringmsg_pb2 import StringMsg from gz.msgs11.vector3d_pb2 import Vector3d from gz.transport import Node, AdvertiseMessageOptions, SubscribeOptions, TopicStatistics - +from gz.transport import transport_implementation from threading import Lock import time @@ -35,6 +35,8 @@ def stringmsg_cb(self, msg: StringMsg): self.msg_counter += 1 self.received_msg = msg.data + @unittest.skipIf(transport_implementation() == "zenoh", + "transport implementation 'zenoh' is not supported") def setUp(self): # Publisher set up self.pub_node = Node() diff --git a/python/test/requester_TEST.py b/python/test/requester_TEST.py index f8bd6e55..df2864af 100644 --- a/python/test/requester_TEST.py +++ b/python/test/requester_TEST.py @@ -16,6 +16,7 @@ from gz.msgs11.int32_pb2 import Int32 from gz.msgs11.stringmsg_pb2 import StringMsg from gz.transport import Node +from gz.transport import transport_implementation import os import subprocess @@ -23,6 +24,8 @@ class RequesterTEST(unittest.TestCase): + @unittest.skipIf(transport_implementation() == "zenoh", + "transport implementation 'zenoh' is not supported") def setUp(self): # Environment Setup gz_partition = "python_requester_test" diff --git a/src/Helpers.cc b/src/Helpers.cc index 5e4ebf49..04367166 100644 --- a/src/Helpers.cc +++ b/src/Helpers.cc @@ -24,6 +24,7 @@ #include #endif +#include "gz/transport/config.hh" #include "gz/transport/Helpers.hh" namespace gz @@ -75,6 +76,14 @@ namespace gz return ::getpid(); #endif } + + ////////////////////////////////////////////////// + std::string getTransportImplementation() + { + if (const char* implEnv = std::getenv("GZ_TRANSPORT_IMPLEMENTATION")) + return std::string(implEnv); + return std::string(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION); + } } } } diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index c5674f32..a9b54b0a 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -88,3 +88,21 @@ TEST(HelpersTest, SplitOneDelimiterAtEnd) EXPECT_EQ("Hello World", pieces[0]); EXPECT_EQ("", pieces[1]); } + +////////////////////////////////////////////////// +/// \brief Check the getTransportImplementation() function. +TEST(HelpersTest, TransportImplementation) +{ + std::string impl = transport::getTransportImplementation(); + EXPECT_FALSE(impl.empty()); + + ASSERT_TRUE(gz::utils::setenv("GZ_TRANSPORT_IMPLEMENTATION", "abc")); + + impl = transport::getTransportImplementation(); + EXPECT_EQ("abc", impl); + + ASSERT_TRUE(gz::utils::setenv("GZ_TRANSPORT_IMPLEMENTATION", "")); + + impl = transport::getTransportImplementation(); + EXPECT_TRUE(impl.empty()); +} diff --git a/src/NodeShared.cc b/src/NodeShared.cc index d7de6fed..d4809fa4 100644 --- a/src/NodeShared.cc +++ b/src/NodeShared.cc @@ -307,17 +307,14 @@ NodeShared::NodeShared() this, std::placeholders::_1)); // Set the Gz Transport implementation (ZeroMQ, Zenoh, ...). - std::string gzImpl; - if (env("GZ_TRANSPORT_IMPLEMENTATION", gzImpl) && !gzImpl.empty()) + std::string gzImpl = getTransportImplementation(); + std::transform(gzImpl.begin(), gzImpl.end(), gzImpl.begin(), ::tolower); + if (gzImpl == "zeromq" || gzImpl == "zenoh") + this->dataPtr->gzImplementation = gzImpl; + else { - std::transform(gzImpl.begin(), gzImpl.end(), gzImpl.begin(), ::tolower); - if (gzImpl == "zeromq" || gzImpl == "zenoh") - this->dataPtr->gzImplementation = gzImpl; - else - { - std::cerr << "Unrecognized value in GZ_TRANSPORT_IMPLEMENTATION. [" - << gzImpl << "]. Ignoring this value" << std::endl; - } + std::cerr << "Unrecognized value in GZ_TRANSPORT_IMPLEMENTATION. [" + << gzImpl << "]. Ignoring this value" << std::endl; } // Start the discovery services. diff --git a/src/NodeSharedPrivate.hh b/src/NodeSharedPrivate.hh index b5602aab..d2c66c18 100644 --- a/src/NodeSharedPrivate.hh +++ b/src/NodeSharedPrivate.hh @@ -32,6 +32,8 @@ #include #endif +#include "gz/transport/config.hh" + #include "gz/transport/Discovery.hh" #include "gz/transport/Node.hh" @@ -223,7 +225,8 @@ namespace gz /// \brief Underlying middleware implementation. /// Supported values are: [zenoh, zeromq]. - public: std::string gzImplementation = "zeromq"; + public: std::string gzImplementation = + std::string(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION); }; } } diff --git a/src/Node_TEST.cc b/src/Node_TEST.cc index 7850455f..38bbe5a1 100644 --- a/src/Node_TEST.cc +++ b/src/Node_TEST.cc @@ -539,6 +539,8 @@ TEST(NodePubTest, BoolOperatorTest) /// \brief A message should not be published if it is not advertised before. TEST(NodeTest, PubWithoutAdvertise) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -649,6 +651,8 @@ TEST(NodeTest, PubSubSameThread) /// \brief A thread can create a node, and send and receive messages. TEST(NodeTest, PubSubSameThreadGenericCb) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -693,6 +697,8 @@ TEST(NodeTest, PubSubSameThreadGenericCb) /// information. TEST(NodeTest, PubSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -775,6 +781,8 @@ TEST(NodeTest, RawPubSubSameThreadMessageInfo) ////////////////////////////////////////////////// TEST(NodeTest, RawPubRawSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -817,6 +825,8 @@ TEST(NodeTest, RawPubRawSubSameThreadMessageInfo) ////////////////////////////////////////////////// TEST(NodeTest, PubRawSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -905,6 +915,8 @@ TEST(NodeTest, PubSubSameThreadLambda) /// information. TEST(NodeTest, PubSubSameThreadLambdaMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -1027,6 +1039,8 @@ TEST(NodeTest, PubSubWithCreateSubscriber) /// \brief Subscribe to a topic using dfferent Subscribe APIs TEST(NodeTest, PubSubWithMixedSubscribeAPIs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -1168,6 +1182,8 @@ TEST(NodeTest, PubSubWithMixedSubscribeAPIs) /// within the same node but it's valid on separate nodes. TEST(NodeTest, AdvertiseTwoEqualTopics) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node1; transport::Node node2; @@ -1359,6 +1375,8 @@ TEST(NodeTest, ClassMemberCallbackMessage) /// publish. This test uses a callback that accepts message information. TEST(NodeTest, ClassMemberCallbackMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.SubscribeWithMessageInfo(); @@ -1377,6 +1395,8 @@ TEST(NodeTest, ClassMemberCallbackMessageInfo) /// function. TEST(NodeTest, ClassMemberCallbackService) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCall(); } @@ -1386,6 +1406,8 @@ TEST(NodeTest, ClassMemberCallbackService) /// using member function. TEST(NodeTest, ClassMemberCallbackServiceWithoutInput) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCallWithoutInput(); } @@ -1394,6 +1416,8 @@ TEST(NodeTest, ClassMemberCallbackServiceWithoutInput) /// \brief Make an asynchronous service call, and then, advertise the service. TEST(NodeTest, ClassMemberRequestServiceBeforeAdvertise) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCallRequestingBeforeAdvertising(); } @@ -1426,6 +1450,8 @@ TEST(NodeTest, TypeMismatch) /// \brief Make an asynchronous service call using free function. TEST(NodeTest, ServiceCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1490,6 +1516,8 @@ TEST(NodeTest, ServiceCallAsync) /// \brief Make an asynchronous service call without input using free function. TEST(NodeTest, ServiceCallWithoutInputAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1552,6 +1580,8 @@ TEST(NodeTest, ServiceCallWithoutInputAsync) /// \using free function. TEST(NodeTest, ServiceWithoutOutputCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1595,6 +1625,8 @@ TEST(NodeTest, ServiceWithoutOutputCallAsync) /// \brief Make an asynchronous service call using lambdas. TEST(NodeTest, ServiceCallAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); std::function @@ -1633,6 +1665,8 @@ TEST(NodeTest, ServiceCallAsyncLambda) /// \brief Make an asynchronous service call without input using lambdas. TEST(NodeTest, ServiceCallWithoutInputAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); std::function advCb = @@ -1666,6 +1700,8 @@ TEST(NodeTest, ServiceCallWithoutInputAsyncLambda) /// \lambdas. TEST(NodeTest, ServiceCallWithoutOutputAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + bool executed = false; std::function advCb = @@ -1689,6 +1725,8 @@ TEST(NodeTest, ServiceCallWithoutOutputAsyncLambda) /// \brief Request multiple service calls at the same time. TEST(NodeTest, MultipleServiceCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1749,6 +1787,8 @@ TEST(NodeTest, MultipleServiceCallAsync) /// \brief Request multiple service calls without input at the same time. TEST(NodeTest, MultipleServiceCallWithoutInputAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1806,6 +1846,8 @@ TEST(NodeTest, MultipleServiceCallWithoutInputAsync) /// \ at the same time. TEST(NodeTest, MultipleServiceWithoutOutputCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1860,6 +1902,8 @@ TEST(NodeTest, MultipleServiceWithoutOutputCallAsync) /// \brief Make a synchronous service call. TEST(NodeTest, ServiceCallSync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1888,6 +1932,8 @@ TEST(NodeTest, ServiceCallSync) /// \brief Make a synchronous service call without input. TEST(NodeTest, ServiceCallWithoutInputSync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 rep; @@ -1913,6 +1959,8 @@ TEST(NodeTest, ServiceCallWithoutInputSync) /// \brief Check a timeout in a synchronous service call. TEST(NodeTest, ServiceCallSyncTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1946,6 +1994,8 @@ TEST(NodeTest, ServiceCallSyncTimeout) /// \brief Check a timeout in a synchronous service call without input. TEST(NodeTest, ServiceCallWithoutInputSyncTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 rep; @@ -2104,6 +2154,8 @@ TEST(NodeTest, PubSubWrongTypesOnPublish) /// the advertised types. TEST(NodeTest, PubSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d msgV; @@ -2136,6 +2188,8 @@ TEST(NodeTest, PubSubWrongTypesOnSubscription) /// advertised type). Check that only the good callback is executed. TEST(NodeTest, PubSubWrongTypesTwoSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2210,6 +2264,8 @@ TEST(NodeTest, SubThrottled) /// publishes at a throttled frequency . TEST(NodeTest, PubThrottled) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2248,6 +2304,8 @@ TEST(NodeTest, PubThrottled) /// is set to true. TEST(NodeTest, IgnoreLocalMessages) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2283,6 +2341,8 @@ TEST(NodeTest, IgnoreLocalMessages) /// that the service call does not succeed. TEST(NodeTest, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d wrongReq; @@ -2314,6 +2374,8 @@ TEST(NodeTest, SrvRequestWrongReq) /// verify that the service call does not succeed. TEST(NodeTest, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -2343,6 +2405,8 @@ TEST(NodeTest, SrvRequestWrongRep) /// should verify that the service call does not succeed. TEST(NodeTest, SrvWithoutInputRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d wrongRep; @@ -2370,6 +2434,8 @@ TEST(NodeTest, SrvWithoutInputRequestWrongRep) /// are used. TEST(NodeTest, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -2405,6 +2471,8 @@ TEST(NodeTest, SrvTwoRequestsOneWrong) /// are used. TEST(NodeTest, SrvWithoutInputTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 goodRep; @@ -2435,6 +2503,8 @@ TEST(NodeTest, SrvWithoutInputTwoRequestsOneWrong) /// verifies that TopicList() returns the list of all the topics advertised. TEST(NodeTest, TopicList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics; transport::Node node1; transport::Node node2; @@ -2465,6 +2535,8 @@ TEST(NodeTest, TopicList) /// Topic remapping is enabled. TEST(NodeTest, TopicListRemap) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics; transport::NodeOptions nodeOptions; nodeOptions.AddTopicRemap(g_topic, g_topic_remap); @@ -2484,6 +2556,8 @@ TEST(NodeTest, TopicListRemap) /// verifies that ServiceList() returns the list of all the services advertised. TEST(NodeTest, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector services; transport::Node node; @@ -2512,6 +2586,8 @@ TEST(NodeTest, ServiceList) /// Topic remapping is enabled. TEST(NodeTest, ServiceListRemap) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector services; transport::NodeOptions nodeOptions; nodeOptions.AddTopicRemap(g_topic, g_topic_remap); diff --git a/src/cmd/gz_TEST.cc b/src/cmd/gz_TEST.cc index 143d1819..172330b3 100644 --- a/src/cmd/gz_TEST.cc +++ b/src/cmd/gz_TEST.cc @@ -124,6 +124,8 @@ exec_with_retry(const std::vector &_args, /// \brief Check 'gz topic -l' running the advertiser on a different process. TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsPublisher, g_partition}); @@ -139,6 +141,8 @@ TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) /// \brief Check 'gz topic -l' running a subscriber on a different process. TEST(gzTest, TopicListSub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; node.Subscribe("/foo", topicCB); node.Subscribe("/bar", genericCb); @@ -162,6 +166,8 @@ TEST(gzTest, TopicListSub) /// \brief Check 'gz topic -i' running the advertiser on a different process. TEST(gzTest, TopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsPublisher, g_partition}); @@ -183,6 +189,8 @@ TEST(gzTest, TopicInfo) /// process. TEST(gzTest, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new responser process that advertises a service. auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsSrvCallReplier, g_partition}); @@ -199,6 +207,8 @@ TEST(gzTest, ServiceList) /// \brief Check 'gz service -i' running the advertiser on a different process. TEST(gzTest, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new responser process that advertises a service. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplier, g_partition}); @@ -216,6 +226,8 @@ TEST(gzTest, ServiceInfo) /// \brief Check 'gz topic -l' running the advertiser on the same process. TEST(gzTest, TopicListSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; msgs::Vector3d msg; @@ -239,6 +251,8 @@ TEST(gzTest, TopicListSameProc) /// \brief Check 'gz topic -i' running the advertiser on the same process. TEST(gzTest, TopicInfoSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; msgs::Vector3d msg; @@ -263,6 +277,8 @@ TEST(gzTest, TopicInfoSameProc) /// \brief Check 'gz service -l' running the advertiser on the same process. TEST(gzTest, ServiceListSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -278,6 +294,8 @@ TEST(gzTest, ServiceListSameProc) /// \brief Check 'gz service -i' running the advertiser on the same process. TEST(gzTest, ServiceInfoSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -294,6 +312,8 @@ TEST(gzTest, ServiceInfoSameProc) /// \brief Check 'gz topic -p' to send a message. TEST(gzTest, TopicPublish) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; g_topicCBStr = "bad_value"; EXPECT_TRUE(node.Subscribe("/bar", topicCB)); @@ -346,6 +366,8 @@ TEST(gzTest, TopicPublish) /// \brief Check 'gz service -r' to request a two-way service. TEST(gzTest, ServiceRequest) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; // Advertise a service. @@ -370,6 +392,8 @@ TEST(gzTest, ServiceRequest) /// \brief Check 'gz service -r' to request a two-way service without timeout. TEST(gzTest, ServiceRequestNoTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; // Advertise a service. @@ -393,6 +417,8 @@ TEST(gzTest, ServiceRequestNoTimeout) /// \brief Check 'gz service -r' to request a one-way service. TEST(gzTest, ServiceOnewayRequest) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + g_topicCBStr = "bad_value"; transport::Node node; @@ -416,6 +442,8 @@ TEST(gzTest, ServiceOnewayRequest) /// \brief Check 'gz service -r' to request a service without input args. TEST(gzTest, ServiceRequestNoInput) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Advertise a service. transport::Node node; std::string service = "/no_input"; @@ -433,6 +461,8 @@ TEST(gzTest, ServiceRequestNoInput) /// \brief Check 'gz topic -e' running the publisher on a separate process. TEST(gzTest, TopicEcho) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, g_partition}); @@ -450,6 +480,8 @@ TEST(gzTest, TopicEcho) /// process. TEST(gzTest, TopicEchoNum) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, g_partition}); @@ -484,6 +516,8 @@ TEST(gzTest, TopicEchoNum) /// consistent flags TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ServiceHelpVsCompletionFlags)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Flags in help message auto helpOutput = custom_exec_str({"service", "--help"}); @@ -517,6 +551,8 @@ TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ServiceHelpVsCompletionFlags)) /// consistent flags TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(TopicHelpVsCompletionFlags)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Flags in help message auto helpOutput = custom_exec_str({"topic", "--help"}); diff --git a/src/cmd/gz_src_TEST.cc b/src/cmd/gz_src_TEST.cc index f4141aa3..27b12239 100644 --- a/src/cmd/gz_src_TEST.cc +++ b/src/cmd/gz_src_TEST.cc @@ -79,6 +79,8 @@ bool srvEcho(const msgs::Int32 &_req, msgs::Int32 &_rep) /// \brief Check cmdTopicInfo running the advertiser on a the same process. TEST(gzTest, cmdTopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -105,6 +107,8 @@ TEST(gzTest, cmdTopicInfo) /// \brief Check cmdServiceInfo running the advertiser on a the same process. TEST(gzTest, cmdServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -129,6 +133,8 @@ TEST(gzTest, cmdServiceInfo) /// \brief Check cmdTopicPub running the advertiser on a the same process. TEST(gzTest, cmdTopicPub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -157,6 +163,8 @@ TEST(gzTest, cmdTopicPub) /// \brief Check cmdServiceReq running the advertiser on a the same process. TEST(gzTest, cmdServiceReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -230,6 +238,8 @@ TEST(gzTest, cmdServiceReq) /// \brief Check cmdTopicEcho running the advertiser on a the same process. TEST(gzTest, cmdTopicEcho) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -252,6 +262,8 @@ TEST(gzTest, cmdTopicEcho) ///////////////////////////////////////////////// TEST(gzTest, cmdTopicEchoOutputFormats) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); diff --git a/test/integration/twoProcsPubSub.cc b/test/integration/twoProcsPubSub.cc index 5ac13b71..0740fc4a 100644 --- a/test/integration/twoProcsPubSub.cc +++ b/test/integration/twoProcsPubSub.cc @@ -107,6 +107,8 @@ void cbRaw(const char * /*_msgData*/, const size_t /*_size*/, /// node receives the message. TEST(twoProcPubSub, PubSubTwoProcsThreeNodes) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); @@ -140,6 +142,8 @@ TEST(twoProcPubSub, PubSubTwoProcsThreeNodes) /// of Publish(~). TEST(twoProcPubSub, RawPubSubTwoProcsThreeNodes) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); @@ -177,6 +181,8 @@ TEST(twoProcPubSub, RawPubSubTwoProcsThreeNodes) /// the advertised types. TEST(twoProcPubSub, PubSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -198,6 +204,8 @@ TEST(twoProcPubSub, PubSubWrongTypesOnSubscription) /// \brief Same as above, but using a raw subscription. TEST(twoProcPubSub, PubRawSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -224,6 +232,8 @@ TEST(twoProcPubSub, PubRawSubWrongTypesOnSubscription) /// (correct and generic). TEST(twoProcPubSub, PubSubWrongTypesTwoSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -257,6 +267,8 @@ TEST(twoProcPubSub, PubSubWrongTypesTwoSubscribers) /// callbacks are executed (correct and generic). TEST(twoProcPubSub, PubSubWrongTypesTwoRawSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -380,6 +392,8 @@ TEST(twoProcPubSub, PubThrottled) /// using a callback that accepts message information. TEST(twoProcPubSub, PubSubMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); reset(); @@ -402,6 +416,8 @@ TEST(twoProcPubSub, PubSubMessageInfo) /// available topics. TEST(twoProcPubSub, TopicList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -448,6 +464,8 @@ TEST(twoProcPubSub, TopicList) /// about the topic. TEST(twoProcPubSub, TopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -484,6 +502,8 @@ TEST(twoProcPubSub, TopicInfo) /// check returns the correct result. TEST(twoProcPubSub, PubSubTwoProcsScopedPub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; for (auto j = 0; j < 2; ++j) @@ -529,6 +549,8 @@ TEST(twoProcPubSub, PubSubTwoProcsScopedPub) /// After that check that only one remaining subscriber receives the message. TEST(twoProcPubSub, PubSubTwoProcsMixedSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); diff --git a/test/integration/twoProcsSrvCall.cc b/test/integration/twoProcsSrvCall.cc index 422689b2..ff7bede5 100644 --- a/test/integration/twoProcsSrvCall.cc +++ b/test/integration/twoProcsSrvCall.cc @@ -104,6 +104,8 @@ void wrongResponse(const msgs::Vector3d &/*_rep*/, bool /*_result*/) /// advertises a service and the other requests a few service calls. TEST_F(twoProcSrvCall, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -148,6 +150,8 @@ TEST_F(twoProcSrvCall, SrvTwoProcs) /// that the service call does not succeed. TEST_F(twoProcSrvCall, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongReq; msgs::Int32 rep; bool result; @@ -178,6 +182,8 @@ TEST_F(twoProcSrvCall, SrvRequestWrongReq) /// verify that the service call does not succeed. TEST_F(twoProcSrvCall, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 req; msgs::Vector3d wrongRep; bool result; @@ -207,6 +213,8 @@ TEST_F(twoProcSrvCall, SrvRequestWrongRep) /// are used. TEST_F(twoProcSrvCall, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 req; msgs::Int32 goodRep; msgs::Vector3d badRep; @@ -244,6 +252,8 @@ TEST_F(twoProcSrvCall, SrvTwoRequestsOneWrong) /// of available services. TEST_F(twoProcSrvCall, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -287,6 +297,8 @@ TEST_F(twoProcSrvCall, ServiceList) /// information about the service. TEST_F(twoProcSrvCall, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallStress.cc b/test/integration/twoProcsSrvCallStress.cc index c6f2c9d1..483662c8 100644 --- a/test/integration/twoProcsSrvCallStress.cc +++ b/test/integration/twoProcsSrvCallStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCall, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplierInc, partition}); diff --git a/test/integration/twoProcsSrvCallSync1.cc b/test/integration/twoProcsSrvCallSync1.cc index 32b8e9f3..92e006ac 100644 --- a/test/integration/twoProcsSrvCallSync1.cc +++ b/test/integration/twoProcsSrvCallSync1.cc @@ -43,6 +43,8 @@ static int data = 5; /// the timeout. TEST(twoProcSrvCallSync1, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplier, partition}); diff --git a/test/integration/twoProcsSrvCallWithoutInput.cc b/test/integration/twoProcsSrvCallWithoutInput.cc index 447dd7ca..15be3976 100644 --- a/test/integration/twoProcsSrvCallWithoutInput.cc +++ b/test/integration/twoProcsSrvCallWithoutInput.cc @@ -107,6 +107,8 @@ void wrongResponse(const msgs::Vector3d &/*_rep*/, bool /*_result*/) /// calls. TEST_F(twoProcSrvCallWithoutInput, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -148,6 +150,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvTwoProcs) /// should verify that the service call does not succeed. TEST_F(twoProcSrvCallWithoutInput, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongRep; bool result; unsigned int timeout = 1000; @@ -174,6 +178,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvRequestWrongRep) /// are used. TEST_F(twoProcSrvCallWithoutInput, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 goodRep; msgs::Vector3d badRep; bool result; @@ -208,6 +214,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvTwoRequestsOneWrong) /// getting the list of available services. TEST_F(twoProcSrvCallWithoutInput, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -250,6 +258,8 @@ TEST_F(twoProcSrvCallWithoutInput, ServiceList) /// getting information about the service. TEST_F(twoProcSrvCallWithoutInput, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallWithoutInputStress.cc b/test/integration/twoProcsSrvCallWithoutInputStress.cc index 2acc7b77..901d364e 100644 --- a/test/integration/twoProcsSrvCallWithoutInputStress.cc +++ b/test/integration/twoProcsSrvCallWithoutInputStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCallWithoutInput, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutInputReplierInc, g_partition}); diff --git a/test/integration/twoProcsSrvCallWithoutInputSync1.cc b/test/integration/twoProcsSrvCallWithoutInputSync1.cc index 118f1eff..b7057543 100644 --- a/test/integration/twoProcsSrvCallWithoutInputSync1.cc +++ b/test/integration/twoProcsSrvCallWithoutInputSync1.cc @@ -42,6 +42,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) /// the timeout. TEST(twoProcSrvCallWithoutInputSync1, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutInputReplier, g_partition}); diff --git a/test/integration/twoProcsSrvCallWithoutOutput.cc b/test/integration/twoProcsSrvCallWithoutOutput.cc index 81968b19..7b2088f7 100644 --- a/test/integration/twoProcsSrvCallWithoutOutput.cc +++ b/test/integration/twoProcsSrvCallWithoutOutput.cc @@ -88,6 +88,8 @@ void reset() /// verify that the service call does not succeed. TEST_F(twoProcSrvCallWithoutOutput, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongReq; wrongReq.set_x(1); @@ -112,6 +114,8 @@ TEST_F(twoProcSrvCallWithoutOutput, SrvRequestWrongReq) /// getting the list of available services. TEST_F(twoProcSrvCallWithoutOutput, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -154,6 +158,8 @@ TEST_F(twoProcSrvCallWithoutOutput, ServiceList) /// getting information about the service. TEST_F(twoProcSrvCallWithoutOutput, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallWithoutOutputStress.cc b/test/integration/twoProcsSrvCallWithoutOutputStress.cc index 3e8d6590..d913790d 100644 --- a/test/integration/twoProcsSrvCallWithoutOutputStress.cc +++ b/test/integration/twoProcsSrvCallWithoutOutputStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCallWithoutOuput, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutOutputReplierInc, g_partition}); diff --git a/test/test_utils.hh b/test/test_utils.hh index ff611398..b6e87753 100644 --- a/test/test_utils.hh +++ b/test/test_utils.hh @@ -21,6 +21,9 @@ #include #include #include +#include + +#include "gz/transport/Helpers.hh" namespace testing { @@ -39,4 +42,11 @@ namespace testing } } // namespace testing +#define CHECK_UNSUPPORTED_IMPLEMENTATION(...) \ +if (std::unordered_set({__VA_ARGS__}).count(\ + gz::transport::getTransportImplementation()) != 0) \ + GTEST_SKIP() << "gz-transport implementation '" \ + << gz::transport::getTransportImplementation() << "' unsupported"; + + #endif // GZ_TRANSPORT_TEST_UTILS_HH_