catkin_make test not running my tests
I am trying to use unit tests in ROS for the first time, using gtest.
The binary for my tests is getting built properly in catkin_ws/devel/lib/project_name/project_name_tests. I can run it directly from the command line and see useful test run output.
However, I can't figure out how to run it in catkin, which would be more convenient. When I run catkin_make test
is seems that ctest runs some other tests:
Running tests...
Test project /home/awagner/catkin_ws/build
Start 1: _ctest_project_name_msgs_roslaunch-check_launch
1/2 Test #1: _ctest_project_name_msgs_roslaunch-check_launch ...***Failed 2.02 sec
Start 2: _ctest_project_name_gtest_project_name_tests
2/2 Test #2: _ctest_project_name_gtest_project_name_tests .......***Failed 0.05 sec
0% tests passed, 2 tests failed out of 2
Total Test time (real) = 2.07 sec
The following tests FAILED:
1 - _ctest_project_name_msgs_roslaunch-check_launch (Failed)
2 - _ctest_project_name_gtest_project_name_tests (Failed)
Errors while running CTest
Here's how I'm declarng my tests in CMakeLists.txt:
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(project_name_tests src/tests.cpp)
endif()
What am I missing?
I had a similar issue when using
catkin_tools
, which was solved by updating thepython3-catkin-tools
package