Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 👷 add gtests to ctest #328

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions diff_drive_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(test_diff_drive_controller
test/test_diff_drive_controller.cpp
Expand All @@ -71,6 +72,7 @@ if(BUILD_TESTING)
target_link_libraries(test_diff_drive_controller
diff_drive_controller
)
gtest_discover_tests(test_diff_drive_controller)

ament_target_dependencies(test_diff_drive_controller
geometry_msgs
Expand All @@ -92,6 +94,7 @@ if(BUILD_TESTING)
controller_manager
ros2_control_test_assets
)
gtest_discover_tests(test_load_diff_drive_controller)

endif()

Expand Down
3 changes: 3 additions & 0 deletions effort_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_joint_group_effort_controller
Expand All @@ -58,6 +59,7 @@ if(BUILD_TESTING)
controller_manager
ros2_control_test_assets
)
gtest_discover_tests(test_load_joint_group_effort_controller)

ament_add_gmock(
test_joint_group_effort_controller
Expand All @@ -67,6 +69,7 @@ if(BUILD_TESTING)
target_link_libraries(test_joint_group_effort_controller
effort_controllers
)
gtest_discover_tests(test_joint_group_effort_controller)
endif()

ament_export_dependencies(
Expand Down
2 changes: 2 additions & 0 deletions force_torque_sensor_broadcaster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ if(BUILD_TESTING)
hardware_interface
ros2_control_test_assets
)
include(GoogleTest)
gtest_discover_tests(test_force_torque_sensor_broadcaster)
endif()

ament_export_include_directories(
Expand Down
3 changes: 3 additions & 0 deletions forward_command_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ if(BUILD_TESTING)
find_package(controller_manager REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_forward_command_controller
Expand All @@ -69,6 +70,7 @@ if(BUILD_TESTING)
hardware_interface
ros2_control_test_assets
)
gtest_discover_tests(test_load_forward_command_controller)

ament_add_gmock(
test_forward_command_controller
Expand All @@ -78,6 +80,7 @@ if(BUILD_TESTING)
target_link_libraries(test_forward_command_controller
forward_command_controller
)
gtest_discover_tests(test_forward_command_controller)
endif()

ament_export_dependencies(
Expand Down
2 changes: 2 additions & 0 deletions gripper_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_gripper_action_controllers
Expand All @@ -72,6 +73,7 @@ if(BUILD_TESTING)
controller_manager
ros2_control_test_assets
)
gtest_discover_tests(test_load_gripper_action_controllers)
endif()

ament_package()
3 changes: 3 additions & 0 deletions imu_sensor_broadcaster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ if(BUILD_TESTING)
find_package(controller_manager REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_imu_sensor_broadcaster
Expand All @@ -76,6 +77,7 @@ if(BUILD_TESTING)
hardware_interface
ros2_control_test_assets
)
gtest_discover_tests(test_load_imu_sensor_broadcaster)

ament_add_gmock(
test_imu_sensor_broadcaster
Expand All @@ -93,6 +95,7 @@ if(BUILD_TESTING)
hardware_interface
ros2_control_test_assets
)
gtest_discover_tests(test_imu_sensor_broadcaster)
endif()

ament_export_include_directories(
Expand Down
3 changes: 3 additions & 0 deletions joint_state_broadcaster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ if(BUILD_TESTING)
find_package(hardware_interface REQUIRED)
find_package(rclcpp REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_joint_state_broadcaster
Expand All @@ -69,6 +70,7 @@ if(BUILD_TESTING)
hardware_interface
ros2_control_test_assets
)
gtest_discover_tests(test_load_joint_state_broadcaster)

ament_add_gmock(
test_joint_state_broadcaster
Expand All @@ -78,6 +80,7 @@ if(BUILD_TESTING)
target_link_libraries(test_joint_state_broadcaster
joint_state_broadcaster
)
gtest_discover_tests(test_joint_state_broadcaster)
endif()

ament_export_dependencies(
Expand Down
5 changes: 5 additions & 0 deletions joint_trajectory_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gtest(test_trajectory test/test_trajectory.cpp)
target_include_directories(test_trajectory PRIVATE include)
target_link_libraries(test_trajectory joint_trajectory_controller)
gtest_discover_tests(test_trajectory)

ament_add_gtest(test_trajectory_controller
test/test_trajectory_controller.cpp
Expand All @@ -82,6 +84,7 @@ if(BUILD_TESTING)
ros2_control_test_assets
trajectory_msgs
)
gtest_discover_tests(test_trajectory_controller)

ament_add_gtest(
test_load_joint_trajectory_controller
Expand All @@ -94,6 +97,7 @@ if(BUILD_TESTING)
realtime_tools
ros2_control_test_assets
)
gtest_discover_tests(test_load_joint_trajectory_controller)

ament_add_gtest(
test_trajectory_actions
Expand All @@ -112,6 +116,7 @@ if(BUILD_TESTING)
trajectory_msgs
realtime_tools
)
gtest_discover_tests(test_trajectory_actions)
endif()

ament_export_dependencies(
Expand Down
3 changes: 3 additions & 0 deletions position_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_joint_group_position_controller
Expand All @@ -58,6 +59,7 @@ if(BUILD_TESTING)
controller_manager
ros2_control_test_assets
)
gtest_discover_tests(test_load_joint_group_position_controller)

ament_add_gmock(
test_joint_group_position_controller
Expand All @@ -67,6 +69,7 @@ if(BUILD_TESTING)
target_link_libraries(test_joint_group_position_controller
position_controllers
)
gtest_discover_tests(test_joint_group_position_controller)
endif()

ament_export_dependencies(
Expand Down
3 changes: 3 additions & 0 deletions velocity_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
include(GoogleTest)

ament_add_gmock(
test_load_joint_group_velocity_controller
Expand All @@ -59,6 +60,7 @@ if(BUILD_TESTING)
controller_manager
ros2_control_test_assets
)
gtest_discover_tests(test_load_joint_group_velocity_controller)

ament_add_gmock(
test_joint_group_velocity_controller
Expand All @@ -68,6 +70,7 @@ if(BUILD_TESTING)
target_link_libraries(test_joint_group_velocity_controller
velocity_controllers
)
gtest_discover_tests(test_joint_group_velocity_controller)
endif()

ament_export_dependencies(
Expand Down