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

How to rostest a single (entire) package in catkin workspace?

asked 2014-11-03 17:49:45 -0600

dsolomon gravatar image

(I believe related to )

I have found through painful trial-and-error that when rostests are defined in a package's CMakeLists.txt, they will not build with the typical catkin_make run_tests_<package>:

  • catkin_make run_tests WORKS
  • catkin_make run_tests_<package> DOESN'T WORK

It is quite painful to not have the ability to run rostests from only one package at a time. Is this expected behavior, and can anyone explain why?

hydro on 12.04

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-03 18:01:58 -0600

ahendrix gravatar image

updated 2014-11-03 18:02:35 -0600

Are you referring to the compilation of your test executables, or the running of those tests? The build process separates these things into two separate build steps, with associated build targets.

The relevant build targets:

  • tests: Builds all of the test nodes. Does not run them.
  • run_tests_<package>: Runs the tests for a specific package. Does not build them.
  • run_tests: Depends on the tests target and all of the run_tests_<package> targets in the current workspace. Building this target causes all of the tests to be built and run.
edit flag offensive delete link more



Also: be sure that CATKIN_ENABLE_TESTING is defined when building your workspace. Properly written CMakeLists.txt should not setup any test-related targets if CATKIN_ENABLE_TESTING is not defined. A normal catkin_make invocation should have that defined, but I thought I'd mention it.

gvdhoorn gravatar image gvdhoorn  ( 2014-11-04 08:54:16 -0600 )edit

Don't know why I just saw this, but thanks guys! Is this behavior from cmake or catkin? And is there a any human-readable source for this information? Reading cmake documentation feels like reading the Rosetta stone: it only makes sense after you already figured it out.

dsolomon gravatar image dsolomon  ( 2015-02-12 07:27:26 -0600 )edit

These targets are created by the test functions that come from rostest and catkin. I don't remember where to find the documentation anymore.

ahendrix gravatar image ahendrix  ( 2015-02-12 23:48:24 -0600 )edit
joq gravatar image joq  ( 2015-02-13 11:12:08 -0600 )edit

Question Tools

1 follower


Asked: 2014-11-03 17:49:45 -0600

Seen: 726 times

Last updated: Nov 03 '14