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

The "add_rostest" macro is not being recognized.

asked 2013-06-18 09:28:41 -0500

Toletum gravatar image

I am trying to create my rostests for catkin, and I've been following the instructions here:

My CMakelists.txt file includes these two lines:

add_executable(guiTest EXCLUDE_FROM_ALL src/test/guiTest.cpp)

However, upon running catkin_make, I get this error:

CMake Error at au_uav_ros/CMakeLists.txt:81 (add_rostest):
  Unknown CMake command "add_rostest".

Why isn't it recognizing add_rostest? My "rospack list" command shows that I have: rostest /opt/ros/groovy/share/rostest. Should I just try re-installing the rostest package?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-06-18 11:19:19 -0500

Toletum gravatar image

The answer had to do with linking libraries. I had to add:

target_link_libraries(guiTest ${catkin_LIBRARIES})

to my CMakesList, and then the test node was found. I don't remember this step being mentioned though for the original rosbuild rostests.

edit flag offensive delete link more

answered 2013-06-18 10:00:01 -0500

joq gravatar image

updated 2013-06-18 12:42:30 -0500

You need this in your package.xml:


In your CMakeLists.txt add it to your catkin components:

find_package(catkin REQUIRED COMPONENTS rostest ...)

Update: regarding your next problem, target_link_libraries() is required for nearly every catkin build target.

edit flag offensive delete link more


Thank you. I followed your suggestions, but once the package does compile, the [au_uav_ros/guiTest] node is not found (or does not exist).

I'm thinking that I have to use: set_target_properties(guiTest PROPERTIES ...) since the migration page says to use this. What would the proper args be?

Toletum gravatar image Toletum  ( 2013-06-18 10:41:35 -0500 )edit

That sounds like a separate question. I doubt it's target properties, but we'll probably need to see (most of) your CMakerLists.txt to figure it out.

joq gravatar image joq  ( 2013-06-18 10:49:31 -0500 )edit

Question Tools


Asked: 2013-06-18 09:28:41 -0500

Seen: 1,111 times

Last updated: Jun 18 '13