catkin_make_isolated run_tests

asked 2018-04-11 06:28:56 -0600

gaschler gravatar image

Hi, I would like to add rostests in pull request https://github.com/googlecartographer... to a project which essentially tests with catkin_make_isolated --use-ninja --install --catkin-make-args run_tests. (Changing this would be a large effort.)

However, it seems catkin_make_isolated --use-ninja --install --catkin-make-args run_tests misses dependencies.

How to reproduce

To simplify things, you can reproduce this on a tiny project that uses a rostest:

git clone https://github.com/gocarlos/ros_unit_tests_example.git

(It uses add_rostest_gtest in https://github.com/gocarlos/ros_unit_... )

I use Lunar on Debian stretch.

1.

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args tests && \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args test

works as intended and passes (but is not the call I intend to have).

2.

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install && \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args run_tests

or

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args tests && \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args run_tests

or

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args run_tests

fail with

[4/4] cd workspace/test_.../src/ros_unit_tests_example/launch/node_launcher.launch\ [workspace/test_ws/src/ros_unit_tests_example/launch/node_launcher.launch] is not a launch file name Cannot find results, writing failure results to 'workspace/test_ws/build_isolated/ros_unit_tests_example/test_results/ros_unit_tests_example/MISSING-rostest-launch_node_launcher.xml' -- run_tests.py: execute commands /opt/ros/lunar/share/rostest/cmake/../../../bin/rostest --pkgdir=workspace/test_ws/src/ros_unit_tests_example --package=ros_unit_tests_example --results-filename launch_node_launcher.xml --results-base-dir workspace/test_ws/build_isolated/ros_unit_tests_example/test_results workspace/test_ws/src/ros_unit_tests_example/launch/node_launcher.launch\ -- run_tests.py: verify result "workspace/test_ws/build_isolated/ros_unit_tests_example/test_results/ros_unit_tests_example/rostest-launch_node_launcher.xml"

3.

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install && \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args test

or

rm -r build_isolated/ devel_isolated/ install_isolated/; \
  CTEST_OUTPUT_ON_FAILURE=1  catkin_make_isolated --use-ninja --install --catkin-make-args test

fail with

[ROSUNIT] Outputting test results to workspace/test_ws/build_isolated/ros_unit_tests_example/test_results/ros_unit_tests_example/rostest-launch_node_launcher.xml [Testcase: testmy_unit_test] ... FAILURE! FAILURE: Test node [ros_unit_tests_example/my_unit_test] does not exist or is not executable File "/usr/lib/python2.7/unittest/case.py", line 329, in run testMethod() File "/opt/ros/lunar/lib/python2.7/dist-packages/rostest/runner.py", line 93, in fn self.fail(message) File "/usr/lib/python2.7/unittest/case.py", line 410, in fail raise self.failureException(msg)

Does this behavior point to a bug?

What is the difference between the targets "test", "tests", "run_tests"?

edit retag flag offensive close merge delete