How to detect launch file validation failure in a script ?
Hello,
I am trying to setup launch file validation within my repo's CI using roslaunch_add_file_check
. My CMakeLists.txt
looks like this :
cmake_minimum_required(VERSION 2.8.3)
project(package)
find_package(catkin REQUIRED)
catkin_package()
if (CATKIN_ENABLE_TESTING)
find_package(roslaunch REQUIRED)
find_package(rostest REQUIRED)
roslaunch_add_file_check(launch)
endif (CATKIN_ENABLE_TESTING)
install(DIRECTORY
config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
I have some (expected) errors in my package when running the test with :
catkin_make --only-pkg-with-deps package
catkin_make run_tests_package
And the output is very clear :
Missing package dependencies: other_package/package.xml: robot_state_publisher (notify upstream maintainer)
But when I try to check the return code of the command with :
echo $?
I get : 0
. Which means the command finished successfully. Which makes it very hard to detect the failure in a script. Is there a way to force cmake to return a non zero code when the test fail ?
Thanks !