Skip to content

Commit

Permalink
Skip some event tests on rmw_zenoh (ros2#1180)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Sep 5, 2024
1 parent 522f347 commit 61077aa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions rcl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ function(test_target)
ament_add_gtest_test(test_events
TEST_NAME test_events${target_suffix}
ENV ${rmw_implementation_env_var}
TIMEOUT 120
)

ament_add_gtest_test(test_wait
Expand Down
37 changes: 37 additions & 0 deletions rcl/test/rcl/test_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ conditional_wait_for_msgs_and_events(
*/
TEST_F(TestEventFixture, test_pubsub_no_deadline_missed)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_OFFERED_DEADLINE_MISSED,
RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
Expand Down Expand Up @@ -443,6 +447,10 @@ TEST_F(TestEventFixture, test_pubsub_no_deadline_missed)
*/
TEST_F(TestEventFixture, test_pubsub_deadline_missed)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_OFFERED_DEADLINE_MISSED,
RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
Expand Down Expand Up @@ -518,6 +526,10 @@ TEST_F(TestEventFixture, test_pubsub_deadline_missed)
*/
TEST_F(TestEventFixture, test_pubsub_liveliness_kill_pub)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_LIVELINESS_LOST,
RCL_SUBSCRIPTION_LIVELINESS_CHANGED);
Expand Down Expand Up @@ -597,6 +609,10 @@ TEST_F(TestEventFixture, test_pubsub_liveliness_kill_pub)
*/
TEST_P(TestEventFixture, test_pubsub_incompatible_qos)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

const auto & input = GetParam();
const auto & qos_policy_kind = input.qos_policy_kind;
const auto & publisher_qos_profile = input.publisher_qos_profile;
Expand Down Expand Up @@ -695,6 +711,10 @@ TEST_F(TestEventFixture, test_bad_event_ini)
*/
TEST_F(TestEventFixture, test_event_is_valid)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

EXPECT_FALSE(rcl_event_is_valid(nullptr));
EXPECT_TRUE(rcl_error_is_set());
rcl_reset_error();
Expand All @@ -707,6 +727,7 @@ TEST_F(TestEventFixture, test_event_is_valid)

rcl_ret_t ret = rcl_publisher_event_init(
&publisher_event_test, &publisher, RCL_PUBLISHER_OFFERED_DEADLINE_MISSED);

ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
EXPECT_TRUE(rcl_event_is_valid(&publisher_event_test));

Expand Down Expand Up @@ -754,6 +775,10 @@ TEST_F(TestEventFixture, test_event_is_invalid) {
*/
TEST_F(TestEventFixture, test_sub_message_lost_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

const rmw_qos_profile_t subscription_qos_profile = default_qos_profile;

rcl_ret_t ret = setup_subscriber(subscription_qos_profile);
Expand Down Expand Up @@ -866,6 +891,10 @@ void event_callback(const void * user_data, size_t number_of_events)
*/
TEST_F(TestEventFixture, test_pub_matched_unmatched_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

rcl_ret_t ret;

// Create one publisher
Expand Down Expand Up @@ -977,6 +1006,10 @@ TEST_F(TestEventFixture, test_pub_matched_unmatched_event)
*/
TEST_F(TestEventFixture, test_sub_matched_unmatched_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

rcl_ret_t ret;

// Create one subscriber
Expand Down Expand Up @@ -1178,6 +1211,10 @@ TEST_F(TestEventFixture, test_pub_previous_matched_event)

TEST_F(TestEventFixture, test_sub_previous_matched_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

// While registering callback for matched event, exist previous matched event
// will trigger callback at once.

Expand Down

0 comments on commit 61077aa

Please sign in to comment.