How can I tell "catkin build" to execute unit tests via valgrind?
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
catkin_tools
is essentially CMake.How would you do this with CMake?