catkin_tools
catkin_tools copied to clipboard
catkin build --catkin-make-args tests fails if a package does not have the tests target
I have 111 packages in my workspace, including test_tf2
(from geometry_experimental
) that does not have a tests
target. catkin build --catkin-make-args tests
fails ("no rule to make target tests").
test_tf2/CMakeLists.txt
starts with the following:
if(NOT CATKIN_ENABLE_TESTING)
return()
endif()
see https://github.com/ros/geometry_experimental/blob/indigo-devel/test_tf2/CMakeLists.txt
So maybe this is because test_tf2/CMakeLists.txt
is bad, but the fact is that catkin_make
has no issue with it.
What I think should happen is that the build continues, so that I can get all the tests built in my workspace.
How about:
catkin build --continue-on-failure --catkin-make-args tests
as pointed out by @bricerebsamen removing those three lines of code makes everything fine. Just remove if(NOT CATKIN_ENABLE_TESTING) return() endif()
from the CMakeLists.txt file. That would make it act like any other catkin package.
I am encountering this on a third-party library which contains a package.xml
to build using cmake
. The library would have test targets, but under a different name. It does not declare catkin test targets. Is there a recommended workaround or solution for this?