Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2013-04-22 16:46:05 -0500

joq gravatar image

No one answered this, so I'll post my own solution. Suppose you have a device driver with unit tests that only work on a machine with that device attached. It will fail, if run as a regression test by the build farm.

So, in the catkin CMakeLists.txt, wrap add_rostest() inside a CMake if () block, like this:

if (${DEVICE_TEST})
  add_rostest(tests/camera_node_hz.test)
  add_rostest(tests/camera_nodelet_hz.test)
endif (${DEVICE_TEST})

Those tests will only run when explicitly configured via CMake:

$ cd build
$ cmake ../src -DDEVICE_TEST 
$ make run_tests

No one answered this, so I'll post my own solution. Suppose you have a device driver with unit tests that only work on a machine with that device attached. It will fail, if run as a regression test by the build farm.

So, in the catkin CMakeLists.txt, wrap add_rostest() inside a CMake if () block, like this:

if (${DEVICE_TEST})
  add_rostest(tests/camera_node_hz.test)
  add_rostest(tests/camera_nodelet_hz.test)
endif (${DEVICE_TEST})

Those tests will only run when explicitly configured via CMake:

$ cd build
$ cmake ../src -DDEVICE_TEST -DDEVICE_TEST=true 
$ make run_tests