AIS-Bonn/catch_ros

Is this compatible with catkin tools ?

abishekh opened this issue · 4 comments

I tried integrating this with my project that is built using catkin tools and I get a segmentation fault along with the message Cannot find results, writing failure results to <build directory> . Any advice to resolve this would be helpful. If there is an example ros package with catch-ros integrated + CMakelists and the build flags used to invoke the tests, I might get a better understanding of what I'm doing wrong.

xqms commented

Yes, we are using catkin_tools ourselves. Can you give more details about what you are trying to do? A minimal example demonstrating the problem would be ideal.

I've followed the guidelines for Variant 1 to setup my CMakeLists:


# Variant 1: standalone test
catch_add_test(planner_tests src/test.cpp 
)
target_link_libraries(planner_tests
cplanner motion_planner_proto
) 

And I have to be within the package folder to get only the current package tests to build/run using
catkin build planning --this --no-deps --catkin-make-args run_tests

This results in a segfault as shown below (taken from the log files)

[100%] Built target planner_tests
[100%] Built target tests
-- run_tests.py: execute commands
  /home/abishekh/catkin_ws/devel/.private/planning/lib/planning/planner_tests -r ros_junit -o /home/abishekh/catkin_ws/build/planning/test_results/planning/catch-planner_tests.xml
Segmentation fault (core dumped)
-- run_tests.py: verify result "/home/abishekh/catkin_ws/build/planning/test_results/planning/catch-planner_tests.xml"
Cannot find results, writing failure results to '/home/abishekh/catkin_ws/build/planning/test_results/planning/MISSING-catch-planner_tests.xml'
[100%] Built target _run_tests_planning_catch_planner_tests
[100%] Built target _run_tests_planning_catch
[100%] Built target _run_tests_planning
[100%] Built target run_tests

Within the build folder the tests-results XML file has the following:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="1" failures="1" time="1" errors="0" name="catch-planner_tests.xml">
  <testcase name="test_ran" status="run" time="1" classname="Results">
    <failure message="Unable to find test results for catch-planner_tests.xml, test did not run.
Expected results in /home/abishekh/catkin_ws/build/planning/test_results/planning/catch-planner_tests.xml" type=""/>
  </testcase>
xqms commented

Could you run

gdb --args /home/abishekh/catkin_ws/devel/.private/planning/lib/planning/planner_tests -r ros_junit -o /home/abishekh/catkin_ws/build/planning/test_results/planning/catch-planner_tests.xml

and generate a backtrace ("run", and when it crashes, "bt")? That would be extremely helpful to pinpoint the problem.

xqms commented

I'm closing this - without further feedback it is impossible to diagnose what went wrong.