Ask Your Question

No executables generated by building unit test cpp with catkin

asked 2013-04-20 09:03:53 -0500

130s gravatar image

updated 2013-04-20 12:16:52 -0500

I'm trying to build by using catkin my gtest testsuite.

catkin_add_gtest replaces rosbuild_add_gtest according to migrating_from_rosbuild wiki page. rosbuild_add_gtest generates executable for gtest according to this page. Therefore I expects that catkin_add_gtest also generates executable for my test cases. However, no executable is found in my catkin workspace after catkin_makeing.

Part of my CMakeLists.txt:

add_library(${PROJECT_NAME} ${mypkg_SRCS} ${mypkg_MOCS} ${mypkg_UIS_H})

## Setting Unit Test
catkin_add_gtest(testsuite_mypkg test/test_marble.cpp)
target_link_libraries(testsuite_mypkg ${PROJECT_NAME})

(A library file specified by ${PROJECT_NAME} is generated successfully).

Result of find:

~/catkin_ws$ find . -iname '*test*mypkg*'

What is missing/wrong?

Also I searched an example that uses the same catkin_add_gtest to generate executable, and I found test_rosbag. But catkin_makeing it hasn't produced any executables either as far as I've tried.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-20 19:40:23 -0500

William gravatar image

I'm not sure about intermediate test executables, but there should be tab completable make targets for running the tests. For example:

$ make run_tests

Should build and run all of the tests.

edit flag offensive delete link more


I see. I found that my question is basically the same with this thread that you answered.

130s gravatar image 130s  ( 2013-04-21 18:34:16 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-04-20 09:03:53 -0500

Seen: 844 times

Last updated: Apr 20 '13