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

Split tests into dedicated test packages #455

65 changes: 0 additions & 65 deletions ackermann_steering_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,68 +51,3 @@ install(TARGETS ${PROJECT_NAME}

install(FILES ackermann_steering_controller_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

if (CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS
controller_manager
geometry_msgs
rostest
rosunit
std_msgs
std_srvs
gazebo_ros
xacro
)
include_directories(${catkin_INCLUDE_DIRS})

add_executable(${PROJECT_NAME}_ackermann_steering_bot test/common/src/ackermann_steering_bot.cpp)
add_dependencies(tests ${PROJECT_NAME}_ackermann_steering_bot)

target_link_libraries(${PROJECT_NAME}_ackermann_steering_bot ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_test
test/ackermann_steering_controller_test/ackermann_steering_controller.test
test/ackermann_steering_controller_test/ackermann_steering_controller_test.cpp)
target_link_libraries(${PROJECT_NAME}_test ${catkin_LIBRARIES})

add_rostest_gtest(${PROJECT_NAME}_nan_test
test/ackermann_steering_controller_nan_test/ackermann_steering_controller_nan.test
test/ackermann_steering_controller_nan_test/ackermann_steering_controller_nan_test.cpp)
target_link_libraries(${PROJECT_NAME}_nan_test ${catkin_LIBRARIES})

add_rostest_gtest(${PROJECT_NAME}_limits_test
test/ackermann_steering_controller_limits_test/ackermann_steering_controller_limits.test
test/ackermann_steering_controller_limits_test/ackermann_steering_controller_limits_test.cpp)
target_link_libraries(${PROJECT_NAME}_limits_test ${catkin_LIBRARIES})

add_rostest_gtest(${PROJECT_NAME}_timeout_test
test/ackermann_steering_controller_timeout_test/ackermann_steering_controller_timeout.test
test/ackermann_steering_controller_timeout_test/ackermann_steering_controller_timeout_test.cpp)
target_link_libraries(${PROJECT_NAME}_timeout_test ${catkin_LIBRARIES})

add_rostest_gtest(ackermann_steering_controller_fail_test
test/ackermann_steering_controller_fail_test/ackermann_steering_controller_wrong.test
test/ackermann_steering_controller_fail_test/ackermann_steering_controller_fail_test.cpp)
target_link_libraries(ackermann_steering_controller_fail_test ${catkin_LIBRARIES})

add_rostest_gtest(${PROJECT_NAME}_odom_tf_test
test/ackermann_steering_controller_odom_tf_test/ackermann_steering_controller_odom_tf.test
test/ackermann_steering_controller_odom_tf_test/ackermann_steering_controller_odom_tf_test.cpp)
target_link_libraries(${PROJECT_NAME}_odom_tf_test ${catkin_LIBRARIES})

add_rostest_gtest(${PROJECT_NAME}_default_odom_frame_test
test/ackermann_steering_controller_default_odom_frame_test/ackermann_steering_controller_default_odom_frame.test
test/ackermann_steering_controller_default_odom_frame_test/ackermann_steering_controller_default_odom_frame_test.cpp)
target_link_libraries(${PROJECT_NAME}_default_odom_frame_test ${catkin_LIBRARIES})

add_rostest_gtest(ackermann_steering_controller_odom_frame_test
test/ackermann_steering_controller_odom_frame_test/ackermann_steering_controller_odom_frame.test
test/ackermann_steering_controller_odom_frame_test/ackermann_steering_controller_odom_frame_test.cpp)
target_link_libraries(ackermann_steering_controller_odom_frame_test ${catkin_LIBRARIES})

add_rostest(test/ackermann_steering_controller_open_loop_test/ackermann_steering_controller_open_loop.test)
add_rostest(test/ackermann_steering_controller_no_wheel_test/ackermann_steering_controller_no_wheel.test)
add_rostest(test/ackermann_steering_controller_no_steer_test/ackermann_steering_controller_no_steer.test)
add_rostest(test/ackermann_steering_controller_radius_param_test/ackermann_steering_controller_radius_param.test)
add_rostest(test/ackermann_steering_controller_radius_param_fail_test/ackermann_steering_controller_radius_param_fail.test)
add_rostest(test/ackermann_steering_controller_separation_param_test/ackermann_steering_controller_separation_param.test)
endif()
10 changes: 0 additions & 10 deletions ackermann_steering_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@
<exec_depend>pluginlib</exec_depend>
<exec_depend>urdf</exec_depend>

<!--Tests-->
<test_depend>controller_manager</test_depend>
<test_depend>gazebo_ros</test_depend>
<test_depend>geometry_msgs</test_depend>
<test_depend>rosunit</test_depend>
<test_depend>rostest</test_depend>
<test_depend>std_msgs</test_depend>
<test_depend>std_srvs</test_depend>
<test_depend>xacro</test_depend>

<export>
<controller_interface plugin="${prefix}/ackermann_steering_controller_plugins.xml"/>
</export>
Expand Down
80 changes: 0 additions & 80 deletions diff_drive_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,83 +44,3 @@ install(TARGETS ${PROJECT_NAME}

install(FILES diff_drive_controller_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

if (CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS controller_manager rosgraph_msgs rostest std_srvs tf)
include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(diffbot test/diffbot.cpp)
target_link_libraries(diffbot ${catkin_LIBRARIES})

add_executable(skidsteerbot test/skidsteerbot.cpp)
target_link_libraries(skidsteerbot ${catkin_LIBRARIES})

add_dependencies(tests diffbot skidsteerbot)

add_rostest_gtest(diff_drive_test
test/diff_drive_controller.test
test/diff_drive_test.cpp)
target_link_libraries(diff_drive_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_nan_test
test/diff_drive_controller_nan.test
test/diff_drive_nan_test.cpp)
target_link_libraries(diff_drive_nan_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_limits_test
test/diff_drive_controller_limits.test
test/diff_drive_limits_test.cpp)
target_link_libraries(diff_drive_limits_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_timeout_test
test/diff_drive_timeout.test
test/diff_drive_timeout_test.cpp)
target_link_libraries(diff_drive_timeout_test ${catkin_LIBRARIES})
add_rostest(test/diff_drive_multipliers.test)
add_rostest(test/diff_drive_left_right_multipliers.test)
add_rostest_gtest(diff_drive_fail_test
test/diff_drive_wrong.test
test/diff_drive_fail_test.cpp)
target_link_libraries(diff_drive_fail_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_odom_tf_test
test/diff_drive_odom_tf.test
test/diff_drive_odom_tf_test.cpp)
target_link_libraries(diff_drive_odom_tf_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_default_cmd_vel_out_test
test/diff_drive_default_cmd_vel_out.test
test/diff_drive_default_cmd_vel_out_test.cpp)
target_link_libraries(diff_drive_default_cmd_vel_out_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_pub_cmd_vel_out_test
test/diff_drive_pub_cmd_vel_out.test
test/diff_drive_pub_cmd_vel_out_test.cpp)
target_link_libraries(diff_drive_pub_cmd_vel_out_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_default_wheel_joint_controller_state_test
test/diff_drive_default_wheel_joint_controller_state.test
test/diff_drive_default_wheel_joint_controller_state_test.cpp)
target_link_libraries(diff_drive_default_wheel_joint_controller_state_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_publish_wheel_joint_controller_state_test
test/diff_drive_publish_wheel_joint_controller_state.test
test/diff_drive_publish_wheel_joint_controller_state_test.cpp)
target_link_libraries(diff_drive_publish_wheel_joint_controller_state_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_default_odom_frame_test
test/diff_drive_default_odom_frame.test
test/diff_drive_default_odom_frame_test.cpp)
target_link_libraries(diff_drive_default_odom_frame_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_odom_frame_test
test/diff_drive_odom_frame.test
test/diff_drive_odom_frame_test.cpp)
target_link_libraries(diff_drive_odom_frame_test ${catkin_LIBRARIES})
add_rostest_gtest(diff_drive_multiple_cmd_vel_publishers_test
test/diff_drive_multiple_cmd_vel_publishers.test
test/diff_drive_multiple_cmd_vel_publishers_test.cpp)
target_link_libraries(diff_drive_multiple_cmd_vel_publishers_test ${catkin_LIBRARIES})
add_rostest(test/diff_drive_open_loop.test)
add_rostest(test/skid_steer_controller.test)
add_rostest(test/skid_steer_no_wheels.test)
add_rostest(test/diff_drive_radius_sphere.test)
add_rostest(test/diff_drive_radius_param.test)
add_rostest(test/diff_drive_radius_param_fail.test)
add_rostest(test/diff_drive_separation_param.test)
add_rostest(test/diff_drive_bad_urdf.test)
add_rostest_gtest(diff_drive_dyn_reconf_test
test/diff_drive_dyn_reconf.test
test/diff_drive_dyn_reconf_test.cpp)
target_link_libraries(diff_drive_dyn_reconf_test ${catkin_LIBRARIES})
endif()
6 changes: 0 additions & 6 deletions diff_drive_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
<depend>urdf</depend>
<depend>pluginlib</depend>

<test_depend>controller_manager</test_depend>
<test_depend>rosgraph_msgs</test_depend>
<test_depend>rostest</test_depend>
<test_depend>std_srvs</test_depend>
<test_depend>xacro</test_depend>

<export>
<controller_interface plugin="${prefix}/diff_drive_controller_plugins.xml"/>
</export>
Expand Down
26 changes: 0 additions & 26 deletions four_wheel_steering_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,3 @@ install(TARGETS ${PROJECT_NAME}

install(FILES four_wheel_steering_controller_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

if(CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS rosgraph_msgs rostest std_srvs controller_manager tf)
include_directories(${catkin_INCLUDE_DIRS})

add_executable(four_wheel_steering test/src/four_wheel_steering.cpp)
target_link_libraries(four_wheel_steering ${catkin_LIBRARIES})

add_dependencies(tests four_wheel_steering)

add_rostest_gtest(four_wheel_steering_controller_twist_cmd_test
test/four_wheel_steering_controller_twist_cmd.test
test/src/four_wheel_steering_twist_cmd_test.cpp)
target_link_libraries(four_wheel_steering_controller_twist_cmd_test ${catkin_LIBRARIES})

add_rostest_gtest(four_wheel_steering_controller_4ws_cmd_test
test/four_wheel_steering_controller_4ws_cmd.test
test/src/four_wheel_steering_4ws_cmd_test.cpp)
target_link_libraries(four_wheel_steering_controller_4ws_cmd_test ${catkin_LIBRARIES})

add_rostest_gtest(four_wheel_steering_wrong_config_test
test/four_wheel_steering_wrong_config.test
test/src/four_wheel_steering_wrong_config.cpp)
target_link_libraries(four_wheel_steering_wrong_config_test ${catkin_LIBRARIES})

endif()
5 changes: 0 additions & 5 deletions four_wheel_steering_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
<depend>urdf_geometry_parser</depend>
<depend>pluginlib</depend>

<test_depend>rosgraph_msgs</test_depend>
<test_depend>rostest</test_depend>
<test_depend>std_srvs</test_depend>
<test_depend>controller_manager</test_depend>

<export>
<controller_interface plugin="${prefix}/four_wheel_steering_controller_plugins.xml"/>
</export>
Expand Down
9 changes: 0 additions & 9 deletions joint_state_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})
add_library(${PROJECT_NAME} src/joint_state_controller.cpp)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

add_rostest_gtest(joint_state_controller_test
test/joint_state_controller.test
test/joint_state_controller_test.cpp)
target_link_libraries(joint_state_controller_test ${PROJECT_NAME})
endif()

# Install
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
Expand Down
2 changes: 0 additions & 2 deletions joint_state_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
<depend>realtime_tools</depend>
<depend>roscpp</depend>

<test_depend>rostest</test_depend>

<export>
<controller_interface plugin="${prefix}/joint_state_plugin.xml"/>
</export>
Expand Down
1 change: 0 additions & 1 deletion joint_state_controller/rosdoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
name: C++ API
output_dir: c++
file_patterns: '*.c *.cpp *.h *.cc *.hh *.dox'
exclude_patterns: 'test'
12 changes: 0 additions & 12 deletions joint_state_controller/test/joint_state_controller.test

This file was deleted.

66 changes: 0 additions & 66 deletions joint_trajectory_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,70 +56,6 @@ add_library(${PROJECT_NAME} src/joint_trajectory_controller.cpp

target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

if(CATKIN_ENABLE_TESTING)
find_package(catkin
REQUIRED COMPONENTS
actionlib
controller_manager
xacro
)

find_package(rostest REQUIRED)
include_directories(include ${catkin_INCLUDE_DIRS})

catkin_add_gtest(quintic_spline_segment_test test/quintic_spline_segment_test.cpp)
target_link_libraries(quintic_spline_segment_test ${catkin_LIBRARIES})

catkin_add_gtest(trajectory_interface_test test/trajectory_interface_test.cpp)
target_link_libraries(trajectory_interface_test ${catkin_LIBRARIES})

catkin_add_gtest(joint_trajectory_segment_test test/joint_trajectory_segment_test.cpp)
target_link_libraries(joint_trajectory_segment_test ${catkin_LIBRARIES})

catkin_add_gtest(joint_trajectory_msg_utils_test test/joint_trajectory_msg_utils_test.cpp)
target_link_libraries(joint_trajectory_msg_utils_test ${catkin_LIBRARIES})

catkin_add_gtest(init_joint_trajectory_test test/init_joint_trajectory_test.cpp)
target_link_libraries(init_joint_trajectory_test ${catkin_LIBRARIES})

add_rostest_gtest(tolerances_test
test/tolerances.test
test/tolerances_test.cpp)
target_link_libraries(tolerances_test ${catkin_LIBRARIES})

add_executable(rrbot test/rrbot.cpp)
target_link_libraries(rrbot ${catkin_LIBRARIES})

add_executable(rrbot_wrapping test/rrbot_wrapping.cpp)
target_link_libraries(rrbot_wrapping ${catkin_LIBRARIES})

add_dependencies(tests rrbot)
add_dependencies(tests rrbot_wrapping)
add_dependencies(tests ${PROJECT_NAME})

add_rostest_gtest(joint_trajectory_controller_test
test/joint_trajectory_controller.test
test/joint_trajectory_controller_test.cpp)
target_link_libraries(joint_trajectory_controller_test ${catkin_LIBRARIES})

add_rostest_gtest(joint_trajectory_controller_stopramp_test
test/joint_trajectory_controller_stopramp.test
test/joint_trajectory_controller_test.cpp)
target_link_libraries(joint_trajectory_controller_stopramp_test ${catkin_LIBRARIES})

add_rostest_gtest(joint_trajectory_controller_vel_test
test/joint_trajectory_controller_vel.test
test/joint_trajectory_controller_test.cpp)
target_link_libraries(joint_trajectory_controller_vel_test ${catkin_LIBRARIES})
target_compile_definitions(joint_trajectory_controller_vel_test PRIVATE TEST_VELOCITY_FF=1)

add_rostest_gtest(joint_trajectory_controller_wrapping_test
test/joint_trajectory_controller_wrapping.test
test/joint_trajectory_controller_wrapping_test.cpp)
target_link_libraries(joint_trajectory_controller_wrapping_test ${catkin_LIBRARIES})

endif()

# Install
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
Expand All @@ -136,5 +72,3 @@ install(TARGETS ${PROJECT_NAME}

install(FILES ros_control_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

# TODO: Install test resource files as well?
4 changes: 0 additions & 4 deletions joint_trajectory_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
<depend>urdf</depend>
<depend>pluginlib</depend>

<test_depend>rostest</test_depend>
<test_depend>controller_manager</test_depend>
<test_depend>xacro</test_depend>

<export>
<controller_interface plugin="${prefix}/ros_control_plugins.xml"/>
</export>
Expand Down
1 change: 0 additions & 1 deletion joint_trajectory_controller/rosdoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
name: C++ API
output_dir: c++
file_patterns: '*.c *.cpp *.h *.cc *.hh *.dox'
exclude_patterns: 'test'
4 changes: 0 additions & 4 deletions joint_trajectory_controller/test/tolerances.test

This file was deleted.

Loading