roslaunch_add_file_check(..) and build dependencies
Having added a roslaunch_add_file_check(..)
to my CMakeLists.txt
, I notice that if the tests are invoked as:
catkin_make run_tests_my_package
in a clean workspace (ie: no build
or devel
directories present), all tests that include launchfiles that start compiled nodes fail. catkin immediately tries to execute the tests, without first compiling the package, or any of its dependencies. Example console output:
####
#### Running command: "make run_tests_my_package -j1" in "/home/user/ros/catkin_ws/build"
####
-- run_tests.py: execute commands
/usr/bin/cmake -E make_directory /home/user/ros/catkin_ws/build/test_results/my_package
/opt/ros/hydro/share/roslaunch/cmake/../scripts/roslaunch-check -o /home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml /home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.xml
checking /home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.xml
...writing test results to /home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml
FAILURE:
[/home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.xml]:
cannot find node [compiled_node_a] in package [some_other_package]
cannot find node [compiled_node_b] in package [my_package]
cannot find node [compiled_node_c] in package [my_package]
wrote test file to [/home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml]
-- run_tests.py: verify result "/home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml"
Built target run_tests_my_package_roslaunch-check_tests_roslaunch_test.xml
Built target run_tests_my_package_roslaunch-check
Built target run_tests_my_package
my_package
has both run and build depends on some_other_package
in its package.xml
. And roslaunch
is a build_depend
of my_package
.
I've tried using add_dependencies(..)
, but couldn't find a working target. It would also mean I'd have to manually make all targets dependencies of my roslaunch test. Is there a way to make the roslaunch tests only run after all other targets have been built?