ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

catkin_make run_tests not launching nodes in .test file

asked 2020-05-20 05:01:49 -0500

ThimoF gravatar image

updated 2020-05-20 05:04:24 -0500

I have a node called "screen_detector_node" and a gtest node called "example_test" that is supposed to test the behavior of the screen_detector node.

When I use roslaunch <package name> example_test.test or rostest <package name> example_test.test both the example_test node and the screen_detector_node are launched and the test runs fine.

But when I use catkin_make run_tests only the example_test node is launched and not the to-be-tested screen_detector_node. It seems as if catkin_make run_tests ignores my .test / .launch file.

The example_test.test file:

 <test test-name="example_test" pkg="touch_arm_robot" type="example_test" />
 <node name="screen_detector_node" pkg="touch_arm_robot" type="screen_detector_node" output="screen"/>

CMakeLists tests snippet:

catkin_add_gtest(example_test test/example_test.test test/example_test.cpp)
target_link_libraries(example_test ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-08-26 06:15:30 -0500

TimMcGilly gravatar image

The isssue is catkin_add_gtest(example_test test/example_test.test test/example_test.cpp)

should be

add_rostest_gtest(example_test test/example_test.test test/example_test.cpp)

edit flag offensive delete link more

Question Tools



Asked: 2020-05-20 05:01:49 -0500

Seen: 145 times

Last updated: May 20 '20