Add fault injection macros and unit tests to rcl_action (#730)

* Add fault injection macros and unit tests to rcl_action

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing  feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>
This commit is contained in:
brawner 2020-08-31 12:16:35 -07:00 committed by Alejandro Hernández Cordero
parent 76a706db9b
commit a270de6825
7 changed files with 305 additions and 2 deletions

View file

@ -81,6 +81,7 @@ if(BUILD_TESTING)
# Gtests
ament_add_gtest(test_action_client
test/rcl_action/test_action_client.cpp
TIMEOUT 360
)
if(TARGET test_action_client)
target_include_directories(test_action_client PUBLIC
@ -95,6 +96,7 @@ if(BUILD_TESTING)
"rcl"
"test_msgs"
)
target_compile_definitions(test_action_client PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
endif()
# get the rmw implementations ahead of time
@ -107,7 +109,7 @@ if(BUILD_TESTING)
function(custom_test_c target)
ament_add_gtest(
"${target}${target_suffix}" ${ARGN}
TIMEOUT 60
TIMEOUT 180
ENV
RCL_ASSERT_RMW_ID_MATCHES=${rmw_implementation}
RMW_IMPLEMENTATION=${rmw_implementation}
@ -115,6 +117,8 @@ if(BUILD_TESTING)
if(TARGET ${target}${target_suffix})
target_compile_definitions(${target}${target_suffix}
PUBLIC "RMW_IMPLEMENTATION=${rmw_implementation}")
target_compile_definitions(${target}${target_suffix}
PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
target_include_directories(${target}${target_suffix} PUBLIC
include
)
@ -143,6 +147,7 @@ if(BUILD_TESTING)
ament_add_gtest(test_action_server
test/rcl_action/test_action_server.cpp
TIMEOUT 120
)
if(TARGET test_action_server)
target_include_directories(test_action_server PUBLIC
@ -157,6 +162,7 @@ if(BUILD_TESTING)
"rcl"
"test_msgs"
)
target_compile_definitions(test_action_server PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
endif()
ament_add_gtest(test_goal_handle
test/rcl_action/test_goal_handle.cpp