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