catkin_tools icon indicating copy to clipboard operation
catkin_tools copied to clipboard

catkin build --catkin-make-args tests fails if a package does not have the tests target

Open bricerebsamen opened this issue 9 years ago • 3 comments

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.

bricerebsamen avatar Mar 12 '15 01:03 bricerebsamen

How about:

catkin build --continue-on-failure --catkin-make-args tests

jbohren avatar Mar 17 '15 03:03 jbohren

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.

meenakshisarkar avatar Jun 12 '18 12:06 meenakshisarkar

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?

wxmerkt avatar Oct 24 '19 10:10 wxmerkt