Skip to content

Commit

Permalink
Add 'mimick' label to tests which use Mimick (#2516)
Browse files Browse the repository at this point in the history
Signed-off-by: Scott K Logan <logans@cottsay.net>
  • Loading branch information
cottsay authored Apr 29, 2024
1 parent 2cd8900 commit 5f912eb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
31 changes: 31 additions & 0 deletions rclcpp/test/rclcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ endif()
ament_add_gtest(
test_exceptions
exceptions/test_exceptions.cpp)
ament_add_test_label(test_exceptions mimick)
if(TARGET test_exceptions)
target_link_libraries(test_exceptions ${PROJECT_NAME} mimick)
endif()
Expand All @@ -52,10 +53,12 @@ if(TARGET test_any_subscription_callback)
target_link_libraries(test_any_subscription_callback ${PROJECT_NAME} ${test_msgs_TARGETS})
endif()
ament_add_gtest(test_client test_client.cpp)
ament_add_test_label(test_client mimick)
if(TARGET test_client)
target_link_libraries(test_client ${PROJECT_NAME} mimick ${rcl_interfaces_TARGETS} ${test_msgs_TARGETS})
endif()
ament_add_gtest(test_clock test_clock.cpp)
ament_add_test_label(test_clock mimick)
if(TARGET test_clock)
target_link_libraries(test_clock ${PROJECT_NAME} mimick ${rcl_interfaces_TARGETS} ${test_msgs_TARGETS})
endif()
Expand All @@ -69,6 +72,7 @@ if(TARGET test_create_timer)
target_include_directories(test_create_timer PRIVATE ./)
endif()
ament_add_gtest(test_generic_client test_generic_client.cpp)
ament_add_test_label(test_generic_client mimick)
if(TARGET test_generic_client)
target_link_libraries(test_generic_client ${PROJECT_NAME}
mimick
Expand All @@ -80,6 +84,7 @@ if(TARGET test_generic_client)
)
endif()
ament_add_gtest(test_client_common test_client_common.cpp)
ament_add_test_label(test_client_common mimick)
if(TARGET test_client_common)
target_link_libraries(test_client_common ${PROJECT_NAME}
mimick
Expand All @@ -106,6 +111,7 @@ function(test_add_callback_groups_to_executor_for_rmw_implementation)
endfunction()
call_for_each_rmw_implementation(test_add_callback_groups_to_executor_for_rmw_implementation)
ament_add_gtest(test_expand_topic_or_service_name test_expand_topic_or_service_name.cpp)
ament_add_test_label(test_expand_topic_or_service_name mimick)
if(TARGET test_expand_topic_or_service_name)
target_link_libraries(test_expand_topic_or_service_name ${PROJECT_NAME} mimick rcl::rcl rmw::rmw)
endif()
Expand Down Expand Up @@ -137,6 +143,7 @@ if(TARGET test_intra_process_buffer)
endif()

ament_add_gtest(test_loaned_message test_loaned_message.cpp)
ament_add_test_label(test_loaned_message mimick)
target_link_libraries(test_loaned_message ${PROJECT_NAME} mimick ${test_msgs_TARGETS})

ament_add_gtest(test_memory_strategy test_memory_strategy.cpp)
Expand All @@ -146,6 +153,7 @@ ament_add_gtest(test_message_memory_strategy test_message_memory_strategy.cpp)
target_link_libraries(test_message_memory_strategy ${PROJECT_NAME} ${test_msgs_TARGETS})

ament_add_gtest(test_node test_node.cpp TIMEOUT 240)
ament_add_test_label(test_node mimick)
if(TARGET test_node)
target_link_libraries(test_node ${PROJECT_NAME} mimick rcpputils::rcpputils rmw::rmw ${test_msgs_TARGETS})
endif()
Expand All @@ -157,6 +165,7 @@ if(TARGET test_node_interfaces__get_node_interfaces)
endif()
ament_add_gtest(test_node_interfaces__node_base
node_interfaces/test_node_base.cpp)
ament_add_test_label(test_node_interfaces__node_base mimick)
if(TARGET test_node_interfaces__node_base)
target_link_libraries(test_node_interfaces__node_base ${PROJECT_NAME} mimick rcl::rcl rmw::rmw)
endif()
Expand All @@ -168,6 +177,7 @@ endif()
ament_add_gtest(test_node_interfaces__node_graph
node_interfaces/test_node_graph.cpp
TIMEOUT 120)
ament_add_test_label(test_node_interfaces__node_graph mimick)
if(TARGET test_node_interfaces__node_graph)
target_link_libraries(test_node_interfaces__node_graph ${PROJECT_NAME} mimick rcl::rcl ${test_msgs_TARGETS})
endif()
Expand All @@ -178,21 +188,25 @@ if(TARGET test_node_interfaces__node_interfaces)
endif()
ament_add_gtest(test_node_interfaces__node_parameters
node_interfaces/test_node_parameters.cpp)
ament_add_test_label(test_node_interfaces__node_parameters mimick)
if(TARGET test_node_interfaces__node_parameters)
target_link_libraries(test_node_interfaces__node_parameters ${PROJECT_NAME} mimick rcpputils::rcpputils)
endif()
ament_add_gtest(test_node_interfaces__node_services
node_interfaces/test_node_services.cpp)
ament_add_test_label(test_node_interfaces__node_services mimick)
if(TARGET test_node_interfaces__node_services)
target_link_libraries(test_node_interfaces__node_services ${PROJECT_NAME} mimick rcl::rcl)
endif()
ament_add_gtest(test_node_interfaces__node_timers
node_interfaces/test_node_timers.cpp)
ament_add_test_label(test_node_interfaces__node_timers mimick)
if(TARGET test_node_interfaces__node_timers)
target_link_libraries(test_node_interfaces__node_timers ${PROJECT_NAME} mimick rcl::rcl)
endif()
ament_add_gtest(test_node_interfaces__node_topics
node_interfaces/test_node_topics.cpp)
ament_add_test_label(test_node_interfaces__node_topics mimick)
if(TARGET test_node_interfaces__node_topics)
target_link_libraries(test_node_interfaces__node_topics ${PROJECT_NAME} mimick rcl::rcl ${test_msgs_TARGETS})
endif()
Expand All @@ -203,6 +217,7 @@ if(TARGET test_node_interfaces__node_type_descriptions)
endif()
ament_add_gtest(test_node_interfaces__node_waitables
node_interfaces/test_node_waitables.cpp)
ament_add_test_label(test_node_interfaces__node_waitables mimick)
if(TARGET test_node_interfaces__node_waitables)
target_link_libraries(test_node_interfaces__node_waitables ${PROJECT_NAME} mimick rcl::rcl)
endif()
Expand Down Expand Up @@ -238,10 +253,12 @@ if(TARGET test_node_global_args)
target_link_libraries(test_node_global_args ${PROJECT_NAME})
endif()
ament_add_gtest(test_node_options test_node_options.cpp)
ament_add_test_label(test_node_options mimick)
if(TARGET test_node_options)
target_link_libraries(test_node_options ${PROJECT_NAME} mimick rcl::rcl)
endif()
ament_add_gtest(test_init_options test_init_options.cpp)
ament_add_test_label(test_init_options mimick)
if(TARGET test_init_options)
target_link_libraries(test_init_options ${PROJECT_NAME} mimick rcl::rcl)
endif()
Expand Down Expand Up @@ -270,6 +287,7 @@ if(TARGET test_parameter_map)
target_link_libraries(test_parameter_map ${PROJECT_NAME} rcl::rcl rcl_yaml_param_parser::rcl_yaml_param_parser rcutils::rcutils)
endif()
ament_add_gtest(test_publisher test_publisher.cpp TIMEOUT 120)
ament_add_test_label(test_publisher mimick)
if(TARGET test_publisher)
target_link_libraries(test_publisher ${PROJECT_NAME} mimick rcl::rcl rcutils::rcutils ${test_msgs_TARGETS})
endif()
Expand Down Expand Up @@ -335,6 +353,7 @@ function(test_qos_event_for_rmw_implementation)
ament_add_gmock(test_qos_event${target_suffix} test_qos_event.cpp
ENV ${rmw_implementation_env_var}
)
ament_add_test_label(test_qos_event${target_suffix} mimick)
if(TARGET test_qos_event${target_suffix})
target_link_libraries(test_qos_event${target_suffix} ${PROJECT_NAME} mimick rcutils::rcutils rmw::rmw ${test_msgs_TARGETS})
endif()
Expand Down Expand Up @@ -362,15 +381,18 @@ if(TARGET test_serialized_message)
target_link_libraries(test_serialized_message ${PROJECT_NAME} rcpputils::rcpputils ${test_msgs_TARGETS})
endif()
ament_add_gtest(test_service test_service.cpp)
ament_add_test_label(test_service mimick)
if(TARGET test_service)
target_link_libraries(test_service ${PROJECT_NAME} mimick ${rcl_interfaces_TARGES} ${test_msgs_TARGETS})
endif()
ament_add_gmock(test_service_introspection test_service_introspection.cpp)
ament_add_test_label(test_service_introspection mimick)
if(TARGET test_service_introspection)
target_link_libraries(test_service_introspection ${PROJECT_NAME} mimick ${service_msgs_TARGETS} ${test_msgs_TARGETS})
endif()
# Creating and destroying nodes is slow with Connext, so this needs larger timeout.
ament_add_gtest(test_subscription test_subscription.cpp TIMEOUT 120)
ament_add_test_label(test_subscription mimick)
if(TARGET test_subscription)
target_link_libraries(test_subscription ${PROJECT_NAME} mimick ${test_msgs_TARGETS})
endif()
Expand Down Expand Up @@ -421,6 +443,7 @@ endif()

ament_add_gtest(test_timer test_timer.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}")
ament_add_test_label(test_timer mimick)
if(TARGET test_timer)
target_link_libraries(test_timer ${PROJECT_NAME} mimick rcl::rcl)
endif()
Expand All @@ -439,6 +462,7 @@ endif()

ament_add_gtest(test_utilities test_utilities.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}")
ament_add_test_label(test_utilities mimick)
if(TARGET test_utilities)
target_link_libraries(test_utilities ${PROJECT_NAME} mimick rcl::rcl)
endif()
Expand Down Expand Up @@ -497,6 +521,7 @@ endif()

ament_add_gtest(test_static_single_threaded_executor executors/test_static_single_threaded_executor.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}")
ament_add_test_label(test_static_single_threaded_executor mimick)
if(TARGET test_static_single_threaded_executor)
target_link_libraries(test_static_single_threaded_executor ${PROJECT_NAME} mimick ${test_msgs_TARGETS})
endif()
Expand All @@ -515,6 +540,7 @@ endif()

ament_add_gtest(test_executor_notify_waitable executors/test_executor_notify_waitable.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}" TIMEOUT 120)
ament_add_test_label(test_executor_notify_waitable mimick)
if(TARGET test_executor_notify_waitable)
target_link_libraries(test_executor_notify_waitable ${PROJECT_NAME} mimick rcpputils::rcpputils)
endif()
Expand All @@ -532,6 +558,7 @@ endif()

ament_add_gtest(test_guard_condition test_guard_condition.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}")
ament_add_test_label(test_guard_condition mimick)
if(TARGET test_guard_condition)
target_link_libraries(test_guard_condition ${PROJECT_NAME} mimick)
endif()
Expand Down Expand Up @@ -565,6 +592,7 @@ if(TARGET test_dynamic_storage)
endif()

ament_add_gtest(test_storage_policy_common wait_set_policies/test_storage_policy_common.cpp)
ament_add_test_label(test_storage_policy_common mimick)
if(TARGET test_storage_policy_common)
target_link_libraries(test_storage_policy_common ${PROJECT_NAME} mimick ${test_msgs_TARGETS})
endif()
Expand Down Expand Up @@ -597,11 +625,13 @@ endif()
ament_add_gtest(test_executor test_executor.cpp
APPEND_LIBRARY_DIRS "${append_library_dirs}"
TIMEOUT 120)
ament_add_test_label(test_executor mimick)
if(TARGET test_executor)
target_link_libraries(test_executor ${PROJECT_NAME} mimick)
endif()

ament_add_gtest(test_graph_listener test_graph_listener.cpp)
ament_add_test_label(test_graph_listener mimick)
if(TARGET test_graph_listener)
target_link_libraries(test_graph_listener ${PROJECT_NAME} mimick)
endif()
Expand All @@ -613,6 +643,7 @@ function(test_subscription_content_filter_for_rmw_implementation)
ENV ${rmw_implementation_env_var}
TIMEOUT 120
)
ament_add_test_label(test_subscription_content_filter${target_suffix} mimick)
if(TARGET test_subscription_content_filter${target_suffix})
target_link_libraries(test_subscription_content_filter${target_suffix} ${PROJECT_NAME} mimick ${test_msgs_TARGETS})
endif()
Expand Down
3 changes: 3 additions & 0 deletions rclcpp_action/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ if(BUILD_TESTING)
add_subdirectory(test/benchmark)

ament_add_gtest(test_client test/test_client.cpp TIMEOUT 180)
ament_add_test_label(test_client mimick)
if(TARGET test_client)
target_link_libraries(test_client
${PROJECT_NAME}
Expand All @@ -93,6 +94,7 @@ if(BUILD_TESTING)
endif()

ament_add_gtest(test_server test/test_server.cpp TIMEOUT 180)
ament_add_test_label(test_server mimick)
if(TARGET test_server)
target_link_libraries(test_server
${PROJECT_NAME}
Expand All @@ -104,6 +106,7 @@ if(BUILD_TESTING)
endif()

ament_add_gtest(test_server_goal_handle test/test_server_goal_handle.cpp)
ament_add_test_label(test_server_goal_handle mimick)
if(TARGET test_server_goal_handle)
target_link_libraries(test_server_goal_handle
${PROJECT_NAME}
Expand Down
5 changes: 5 additions & 0 deletions rclcpp_lifecycle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ if(BUILD_TESTING)
endif()

ament_add_gtest(test_lifecycle_node test/test_lifecycle_node.cpp TIMEOUT 120)
ament_add_test_label(test_lifecycle_node mimick)
if(TARGET test_lifecycle_node)
target_link_libraries(test_lifecycle_node ${PROJECT_NAME} mimick rcl_lifecycle::rcl_lifecycle rclcpp::rclcpp rcutils::rcutils)
endif()
Expand All @@ -103,6 +104,7 @@ if(BUILD_TESTING)
target_link_libraries(test_lifecycle_publisher ${PROJECT_NAME} rcl_lifecycle::rcl_lifecycle rclcpp::rclcpp ${test_msgs_TARGETS})
endif()
ament_add_gtest(test_lifecycle_service_client test/test_lifecycle_service_client.cpp TIMEOUT 120)
ament_add_test_label(test_lifecycle_service_client mimick)
if(TARGET test_lifecycle_service_client)
target_link_libraries(test_lifecycle_service_client
${PROJECT_NAME}
Expand All @@ -113,6 +115,7 @@ if(BUILD_TESTING)
rcutils::rcutils)
endif()
ament_add_gtest(test_client test/test_client.cpp TIMEOUT 120)
ament_add_test_label(test_client mimick)
if(TARGET test_client)
target_link_libraries(test_client
${PROJECT_NAME}
Expand All @@ -121,6 +124,7 @@ if(BUILD_TESTING)
rclcpp::rclcpp)
endif()
ament_add_gtest(test_service test/test_service.cpp TIMEOUT 120)
ament_add_test_label(test_service mimick)
if(TARGET test_service)
target_link_libraries(test_service
${PROJECT_NAME}
Expand All @@ -145,6 +149,7 @@ if(BUILD_TESTING)
target_link_libraries(test_state_wrapper ${PROJECT_NAME} rcl_lifecycle::rcl_lifecycle rclcpp::rclcpp)
endif()
ament_add_gtest(test_transition_wrapper test/test_transition_wrapper.cpp)
ament_add_test_label(test_transition_wrapper mimick)
if(TARGET test_transition_wrapper)
target_link_libraries(test_transition_wrapper ${PROJECT_NAME} mimick rcl_lifecycle::rcl_lifecycle rclcpp::rclcpp rcutils::rcutils)
target_compile_definitions(test_transition_wrapper
Expand Down

0 comments on commit 5f912eb

Please sign in to comment.