How can I tell "catkin build" to execute unit tests via valgrind?

asked 2019-04-10 02:46:39 -0500

TOMBOMBADIL gravatar image

updated 2019-04-10 09:59:38 -0500

My environment: Ubuntu 16.04 with ROS kinetic.

I have 2 scripts in my CI set up to build and test the C++ code:

build packages with optimization

catkin config -w ws --source .. --cmake-args -DCMAKE_BUILD_TYPE=Debug

catkin build -w ws --catkin-make-args all tests

run C++ unit tests

catkin build -w ws --catkin-make-args run_tests

catkin_test_results # this command returns error code

What I would like to do now, is run the unit tests inside valgrind. I managed to get to work the following:

valgrind --error-exitcode=1 --leak-check=yes catkin build -w ws --catkin-make-args run_tests

But, obviously, that runs the whole catkin part in valgrind as well, which results in hundreds of errors for libpython (false positives?)

So, what I managed to get is: valgrind -> catkin build -> unit test

But what I actually want is: catkin build -> valgrind -> unit test

edit retag flag offensive close merge delete


catkin_tools is essentially CMake.

How would you do this with CMake?

gvdhoorn gravatar imagegvdhoorn ( 2019-04-10 12:29:48 -0500 )edit