Skip to content

Commit 14c53e1

Browse files
authored
Increase test coverage of rclcpp_lifecycle to 96% (#1298)
* Increase test coverage of rclcpp_lifecycle to 96% Signed-off-by: Stephen Brawner <[email protected]> * PR Fixup Signed-off-by: Stephen Brawner <[email protected]> * test_depend Signed-off-by: Stephen Brawner <[email protected]> * rcutils test_depend Signed-off-by: Stephen Brawner <[email protected]> * More windows warnings Signed-off-by: Stephen Brawner <[email protected]>
1 parent 374deb9 commit 14c53e1

File tree

7 files changed

+921
-14
lines changed

7 files changed

+921
-14
lines changed

rclcpp_lifecycle/CMakeLists.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,27 @@ if(BUILD_TESTING)
5656
ament_target_dependencies(test_lifecycle_node
5757
"rcl_lifecycle"
5858
"rclcpp"
59+
"rcutils"
5960
)
60-
target_link_libraries(test_lifecycle_node ${PROJECT_NAME})
61+
target_link_libraries(test_lifecycle_node ${PROJECT_NAME} mimick)
62+
endif()
63+
ament_add_gtest(test_lifecycle_publisher test/test_lifecycle_publisher.cpp)
64+
if(TARGET test_lifecycle_publisher)
65+
ament_target_dependencies(test_lifecycle_publisher
66+
"rcl_lifecycle"
67+
"rclcpp"
68+
"test_msgs"
69+
)
70+
target_link_libraries(test_lifecycle_publisher ${PROJECT_NAME})
6171
endif()
6272
ament_add_gtest(test_lifecycle_service_client test/test_lifecycle_service_client.cpp)
6373
if(TARGET test_lifecycle_service_client)
6474
ament_target_dependencies(test_lifecycle_service_client
6575
"rcl_lifecycle"
6676
"rclcpp"
77+
"rcutils"
6778
)
68-
target_link_libraries(test_lifecycle_service_client ${PROJECT_NAME})
79+
target_link_libraries(test_lifecycle_service_client ${PROJECT_NAME} mimick)
6980
endif()
7081
ament_add_gtest(test_state_machine_info test/test_state_machine_info.cpp)
7182
if(TARGET test_state_machine_info)
@@ -104,8 +115,12 @@ if(BUILD_TESTING)
104115
ament_target_dependencies(test_transition_wrapper
105116
"rcl_lifecycle"
106117
"rclcpp"
118+
"rcutils"
119+
)
120+
target_link_libraries(test_transition_wrapper ${PROJECT_NAME} mimick)
121+
target_compile_definitions(test_transition_wrapper
122+
PUBLIC RCUTILS_ENABLE_FAULT_INJECTION
107123
)
108-
target_link_libraries(test_transition_wrapper ${PROJECT_NAME})
109124
endif()
110125
endif()
111126

rclcpp_lifecycle/package.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<test_depend>ament_cmake_gtest</test_depend>
2525
<test_depend>ament_lint_auto</test_depend>
2626
<test_depend>ament_lint_common</test_depend>
27+
<test_depend>mimick_vendor</test_depend>
28+
<test_depend>rcutils</test_depend>
29+
<test_depend>test_msgs</test_depend>
2730

2831
<export>
2932
<build_type>ament_cmake</build_type>

0 commit comments

Comments
 (0)