Ask Your Question
0

catkin_make test not running my tests

asked 2015-10-27 07:46:19 -0500

drewm1980 gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-10-27 12:29:19 -0500

joq gravatar image

See the answer to this earlier question:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-10-27 07:46:19 -0500

Seen: 1,227 times

Last updated: Oct 27 '15