No executables generated by building unit test cpp with catkin
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_make
ing.
Part of my CMakeLists.txt:
include_directories(${mypkg_INCLUDE_DIRECTORIES} ${catkin_INCLUDE_DIRS} ${MYDEPENDLIB_INCLUDE_DIR})
add_library(${PROJECT_NAME} ${mypkg_SRCS} ${mypkg_MOCS} ${mypkg_UIS_H})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${MYDEPENDLIB_LIBRARIES})
## 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*'
./src/mypkg/test/test_mypkg.cpp
./build/mypkg/CMakeFiles/_run_tests_mypkg.dir
./build/mypkg/CMakeFiles/testsuite_mypkg.dir
./build/mypkg/CMakeFiles/_run_tests_mypkg_gtest.dir
./build/mypkg/CMakeFiles/run_tests_mypkg.dir
./build/mypkg/CMakeFiles/_run_tests_mypkg_gtest_testsuite_mypkg.dir
./build/mypkg/CMakeFiles/run_tests_mypkg_gtest.dir
./build/mypkg/CMakeFiles/run_tests_mypkg_gtest_testsuite_mypkg.dir
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_make
ing it hasn't produced any executables either as far as I've tried.
Thanks!