From b91d8b0233d7958781c8a538366ae22c19b90673 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Fri, 9 Feb 2024 08:39:20 +0100 Subject: [PATCH] updated the test format --- CMakeLists.txt | 4 +- test/CMakeLists.txt | 255 ++---------------- test/attitude_converter/CMakeLists.txt | 17 ++ .../attitude_converter.test | 12 +- test/compile_tests.sh | 10 + test/gather_coverage.sh | 25 ++ test/geometry/CMakeLists.txt | 17 ++ test/geometry/geometry.test | 12 +- test/math/CMakeLists.txt | 17 ++ test/math/math.test | 12 +- test/median_filter/CMakeLists.txt | 17 ++ test/median_filter/median_filter.test | 12 +- test/param_loader/CMakeLists.txt | 17 ++ test/param_loader/param_loader.test | 16 +- test/publisher_handler/CMakeLists.txt | 16 ++ test/publisher_handler/publisher_handler.test | 12 +- test/repredictor/CMakeLists.txt | 16 ++ test/repredictor/repredictor.test | 13 +- test/run_tests.sh | 8 + test/service_client_handler/CMakeLists.txt | 16 ++ .../service_client_handler.test | 12 +- test/subscribe_handler/CMakeLists.txt | 17 ++ test/subscribe_handler/subscribe_handler.test | 12 +- test/timeout_manager/CMakeLists.txt | 18 ++ test/timeout_manager/timeout_manager.test | 12 +- test/timer/CMakeLists.txt | 18 ++ test/timer/timer.test | 12 +- test/transformer/CMakeLists.txt | 18 ++ test/transformer/transformer.test | 12 +- test/ukf/CMakeLists.txt | 16 ++ test/ukf/ukf.test | 12 +- test/utils/CMakeLists.txt | 17 ++ test/utils/utils.test | 12 +- test/vector_converter/CMakeLists.txt | 16 ++ test/vector_converter/test.cpp | 2 +- test/vector_converter/vector_converter.test | 12 +- 36 files changed, 482 insertions(+), 260 deletions(-) create mode 100644 test/attitude_converter/CMakeLists.txt create mode 100755 test/compile_tests.sh create mode 100755 test/gather_coverage.sh create mode 100644 test/geometry/CMakeLists.txt create mode 100644 test/math/CMakeLists.txt create mode 100644 test/median_filter/CMakeLists.txt create mode 100644 test/param_loader/CMakeLists.txt create mode 100644 test/publisher_handler/CMakeLists.txt create mode 100644 test/repredictor/CMakeLists.txt create mode 100755 test/run_tests.sh create mode 100644 test/service_client_handler/CMakeLists.txt create mode 100644 test/subscribe_handler/CMakeLists.txt create mode 100644 test/timeout_manager/CMakeLists.txt create mode 100644 test/timer/CMakeLists.txt create mode 100644 test/transformer/CMakeLists.txt create mode 100644 test/ukf/CMakeLists.txt create mode 100644 test/utils/CMakeLists.txt create mode 100644 test/vector_converter/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e2319896..6e3e0237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,7 +375,9 @@ target_link_libraries(cyclic_example ## | Testing | ## -------------------------------------------------------------- -if(CATKIN_ENABLE_TESTING) +if(CATKIN_ENABLE_TESTING AND MRS_ENABLE_TESTING) + + message(WARNING "Testing enabled.") add_subdirectory(test) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 868167f4..cb258122 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,256 +1,31 @@ find_package(rostest REQUIRED) -# TimeoutManager +add_subdirectory(./attitude_converter) -add_rostest_gtest(TimeoutManagerTest - timeout_manager/timeout_manager.test - timeout_manager/test.cpp - ) +add_subdirectory(./geometry) -target_link_libraries(TimeoutManagerTest - MrsLib_TimeoutManager - MrsLib_Utils - ${catkin_LIBRARIES} - ) +add_subdirectory(./math) -add_dependencies(TimeoutManagerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) +add_subdirectory(./median_filter) -# MathTest +add_subdirectory(./param_loader) -add_rostest_gtest(MathTest - math/math.test - math/test.cpp - ) +add_subdirectory(./publisher_handler) -target_link_libraries(MathTest - MrsLib_Math - ${catkin_LIBRARIES} - ) +add_subdirectory(./repredictor) -add_dependencies(MathTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) +add_subdirectory(./service_client_handler) -# GeometryTest +add_subdirectory(./subscribe_handler) -add_rostest_gtest(GeometryTest - geometry/geometry.test - geometry/test.cpp - ) +add_subdirectory(./timeout_manager) -target_link_libraries(GeometryTest - MrsLib_Geometry - ${catkin_LIBRARIES} - ) +add_subdirectory(./timer) -add_dependencies(GeometryTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) +add_subdirectory(./transformer) -# AttitudeConverterTest +add_subdirectory(./ukf) -add_rostest_gtest(AttitudeConverterTest - attitude_converter/attitude_converter.test - attitude_converter/test.cpp - ) +add_subdirectory(./utils) -target_link_libraries(AttitudeConverterTest - MrsLib_AttitudeConverter - ${catkin_LIBRARIES} - ) - -add_dependencies(AttitudeConverterTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# UtilsTest - -add_rostest_gtest(UtilsTest - utils/utils.test - utils/test.cpp - ) - -target_link_libraries(UtilsTest - MrsLib_Utils - ${catkin_LIBRARIES} - ) - -add_dependencies(UtilsTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# UkfTest - -add_rostest_gtest(UkfTest - ukf/ukf.test - ukf/test.cpp - ) - -target_link_libraries(UkfTest - ${catkin_LIBRARIES} - ) - -add_dependencies(UkfTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# TransformerTest - -add_rostest_gtest(TransformerTest - transformer/transformer.test - transformer/test.cpp - ) - -target_link_libraries(TransformerTest - MrsLib_Transformer - MrsLib_Geometry - ${catkin_LIBRARIES} - ) - -add_dependencies(TransformerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# ParamLoaderTest - -add_rostest_gtest(ParamLoaderTest - param_loader/param_loader.test - param_loader/test.cpp - ) - -target_link_libraries(ParamLoaderTest - MrsLib_ParamLoader - ${catkin_LIBRARIES} - ) - -add_dependencies(ParamLoaderTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# SubscribeHandlerTest - -add_rostest_gtest(SubscribeHandlerTest - subscribe_handler/subscribe_handler.test - subscribe_handler/test.cpp - ) - -target_link_libraries(SubscribeHandlerTest - MrsLib_TimeoutManager - ${catkin_LIBRARIES} - ) - -add_dependencies(SubscribeHandlerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# RepredictorTest - -add_rostest_gtest(RepredictorTest - repredictor/repredictor.test - repredictor/test.cpp - ) - -target_link_libraries(RepredictorTest - ${catkin_LIBRARIES} - ) - -add_dependencies(RepredictorTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# TimerTest - -add_rostest_gtest(TimerTest - timer/timer.test - timer/test.cpp - ) - -target_link_libraries(TimerTest - MrsLib_Timer - MrsLib_Utils - ${catkin_LIBRARIES} - ) - -add_dependencies(TimerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# MedianFilterTest - -add_rostest_gtest(MedianFilterTest - median_filter/median_filter.test - median_filter/test.cpp - ) - -target_link_libraries(MedianFilterTest - MrsLib_MedianFilter - ${catkin_LIBRARIES} - ) - -add_dependencies(MedianFilterTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# ServiceClientHandlerTest - -add_rostest_gtest(ServiceClientHandlerTest - service_client_handler/service_client_handler.test - service_client_handler/test.cpp - ) - -target_link_libraries(ServiceClientHandlerTest - ${catkin_LIBRARIES} - ) - -add_dependencies(ServiceClientHandlerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# PublisherHandlerTest - -add_rostest_gtest(PublisherHandlerTest - publisher_handler/publisher_handler.test - publisher_handler/test.cpp - ) - -target_link_libraries(PublisherHandlerTest - ${catkin_LIBRARIES} - ) - -add_dependencies(PublisherHandlerTest - ${${PROJECT_NAME}_EXPORTED_TARGETS} - ${catkin_EXPORTED_TARGETS} - ) - -# add_rostest_gtest(VectorConverterTest -# vector_converter/vector_converter.test -# vector_converter/test.cpp -# ) -# -# target_link_libraries(VectorConverterTest -# ${catkin_LIBRARIES} -# ) -# -# target_include_directories(VectorConverterTest PRIVATE -# ${pcl_ros_INCLUDE_DIRS} -# ) -# -# add_dependencies(VectorConverterTest -# ${${PROJECT_NAME}_EXPORTED_TARGETS} -# ${catkin_EXPORTED_TARGETS} -# ) +add_subdirectory(./vector_converter) diff --git a/test/attitude_converter/CMakeLists.txt b/test/attitude_converter/CMakeLists.txt new file mode 100644 index 00000000..18e4d273 --- /dev/null +++ b/test/attitude_converter/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_AttitudeConverter + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/attitude_converter/attitude_converter.test b/test/attitude_converter/attitude_converter.test index 1307c99e..a2c87c7c 100644 --- a/test/attitude_converter/attitude_converter.test +++ b/test/attitude_converter/attitude_converter.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/compile_tests.sh b/test/compile_tests.sh new file mode 100755 index 00000000..efbc0582 --- /dev/null +++ b/test/compile_tests.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR + +# build the package +catkin build --this # it has to be fully built normally before building with --catkin-make-args tests +catkin build --this -DMRS_ENABLE_TESTING=1 --no-deps --catkin-make-args tests diff --git a/test/gather_coverage.sh b/test/gather_coverage.sh new file mode 100755 index 00000000..27404da6 --- /dev/null +++ b/test/gather_coverage.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +while [ ! -e ".catkin_tools" ]; do + cd .. + if [[ `pwd` == "/" ]]; then + # we reached the root and didn't find the build/COLCON_IGNORE file - that's a fail! + echo "$0: could not find the root of the current workspace". + return 1 + fi +done + +WORKSPACE_NAME=${PWD##*/} + +cd build + +lcov --capture --directory . --output-file coverage.info +lcov --remove coverage.info "*/test/*" --output-file coverage.info.removed +lcov --extract coverage.info.removed "*/${WORKSPACE_NAME}/src/*" --output-file coverage.info.cleaned +genhtml --title "MRS UAV System - Test coverage report" --demangle-cpp --legend --frames --show-details -o coverage_html coverage.info.cleaned | tee /tmp/genhtml.log + +COVERAGE_PCT=`cat /tmp/genhtml.log | tail -n 1 | awk '{print $2}'` + +echo "Coverage: $COVERAGE_PCT" + +xdg-open coverage_html/index.html diff --git a/test/geometry/CMakeLists.txt b/test/geometry/CMakeLists.txt new file mode 100644 index 00000000..3cfba1a2 --- /dev/null +++ b/test/geometry/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_Geometry + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/geometry/geometry.test b/test/geometry/geometry.test index bf3c2900..a2c87c7c 100644 --- a/test/geometry/geometry.test +++ b/test/geometry/geometry.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/math/CMakeLists.txt b/test/math/CMakeLists.txt new file mode 100644 index 00000000..4311688e --- /dev/null +++ b/test/math/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_Math + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/math/math.test b/test/math/math.test index bf94d7d2..a2c87c7c 100644 --- a/test/math/math.test +++ b/test/math/math.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/median_filter/CMakeLists.txt b/test/median_filter/CMakeLists.txt new file mode 100644 index 00000000..37862ac5 --- /dev/null +++ b/test/median_filter/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_MedianFilter + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/median_filter/median_filter.test b/test/median_filter/median_filter.test index 2b38765a..a2c87c7c 100644 --- a/test/median_filter/median_filter.test +++ b/test/median_filter/median_filter.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/param_loader/CMakeLists.txt b/test/param_loader/CMakeLists.txt new file mode 100644 index 00000000..f8450778 --- /dev/null +++ b/test/param_loader/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_ParamLoader + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/param_loader/param_loader.test b/test/param_loader/param_loader.test index 7e657296..9c489330 100644 --- a/test/param_loader/param_loader.test +++ b/test/param_loader/param_loader.test @@ -1,9 +1,19 @@ - + - - + + + + + + + + + + + + diff --git a/test/publisher_handler/CMakeLists.txt b/test/publisher_handler/CMakeLists.txt new file mode 100644 index 00000000..bf8f9853 --- /dev/null +++ b/test/publisher_handler/CMakeLists.txt @@ -0,0 +1,16 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/publisher_handler/publisher_handler.test b/test/publisher_handler/publisher_handler.test index addbc783..a2c87c7c 100644 --- a/test/publisher_handler/publisher_handler.test +++ b/test/publisher_handler/publisher_handler.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/repredictor/CMakeLists.txt b/test/repredictor/CMakeLists.txt new file mode 100644 index 00000000..bf8f9853 --- /dev/null +++ b/test/repredictor/CMakeLists.txt @@ -0,0 +1,16 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/repredictor/repredictor.test b/test/repredictor/repredictor.test index f095fc1e..a2c87c7c 100644 --- a/test/repredictor/repredictor.test +++ b/test/repredictor/repredictor.test @@ -1,7 +1,16 @@ - + + + + + + + + + + + - diff --git a/test/run_tests.sh b/test/run_tests.sh new file mode 100755 index 00000000..5eb1f562 --- /dev/null +++ b/test/run_tests.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR + +catkin test --this -i -p 1 -s -i diff --git a/test/service_client_handler/CMakeLists.txt b/test/service_client_handler/CMakeLists.txt new file mode 100644 index 00000000..bf8f9853 --- /dev/null +++ b/test/service_client_handler/CMakeLists.txt @@ -0,0 +1,16 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/service_client_handler/service_client_handler.test b/test/service_client_handler/service_client_handler.test index 1f978055..a2c87c7c 100644 --- a/test/service_client_handler/service_client_handler.test +++ b/test/service_client_handler/service_client_handler.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/subscribe_handler/CMakeLists.txt b/test/subscribe_handler/CMakeLists.txt new file mode 100644 index 00000000..f946d073 --- /dev/null +++ b/test/subscribe_handler/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_TimeoutManager + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/subscribe_handler/subscribe_handler.test b/test/subscribe_handler/subscribe_handler.test index a16713e7..a2c87c7c 100644 --- a/test/subscribe_handler/subscribe_handler.test +++ b/test/subscribe_handler/subscribe_handler.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/timeout_manager/CMakeLists.txt b/test/timeout_manager/CMakeLists.txt new file mode 100644 index 00000000..6d5f4ab1 --- /dev/null +++ b/test/timeout_manager/CMakeLists.txt @@ -0,0 +1,18 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_TimeoutManager + MrsLib_Utils + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/timeout_manager/timeout_manager.test b/test/timeout_manager/timeout_manager.test index 27326faf..a2c87c7c 100644 --- a/test/timeout_manager/timeout_manager.test +++ b/test/timeout_manager/timeout_manager.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/timer/CMakeLists.txt b/test/timer/CMakeLists.txt new file mode 100644 index 00000000..51690a3d --- /dev/null +++ b/test/timer/CMakeLists.txt @@ -0,0 +1,18 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_Timer + MrsLib_Utils + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/timer/timer.test b/test/timer/timer.test index dd633cb0..a2c87c7c 100644 --- a/test/timer/timer.test +++ b/test/timer/timer.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/transformer/CMakeLists.txt b/test/transformer/CMakeLists.txt new file mode 100644 index 00000000..578cc727 --- /dev/null +++ b/test/transformer/CMakeLists.txt @@ -0,0 +1,18 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_Transformer + MrsLib_Geometry + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/transformer/transformer.test b/test/transformer/transformer.test index d5e94de7..d9ba5d8e 100644 --- a/test/transformer/transformer.test +++ b/test/transformer/transformer.test @@ -1,10 +1,20 @@ + + + + + + + + + + - + diff --git a/test/ukf/CMakeLists.txt b/test/ukf/CMakeLists.txt new file mode 100644 index 00000000..bf8f9853 --- /dev/null +++ b/test/ukf/CMakeLists.txt @@ -0,0 +1,16 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/ukf/ukf.test b/test/ukf/ukf.test index 9f8f6fb8..a2c87c7c 100644 --- a/test/ukf/ukf.test +++ b/test/ukf/ukf.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/utils/CMakeLists.txt b/test/utils/CMakeLists.txt new file mode 100644 index 00000000..11803893 --- /dev/null +++ b/test/utils/CMakeLists.txt @@ -0,0 +1,17 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + MrsLib_Utils + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/utils/utils.test b/test/utils/utils.test index bb0e7048..a2c87c7c 100644 --- a/test/utils/utils.test +++ b/test/utils/utils.test @@ -1,6 +1,16 @@ - + + + + + + + + + + + diff --git a/test/vector_converter/CMakeLists.txt b/test/vector_converter/CMakeLists.txt new file mode 100644 index 00000000..bf8f9853 --- /dev/null +++ b/test/vector_converter/CMakeLists.txt @@ -0,0 +1,16 @@ +get_filename_component(TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +catkin_add_executable_with_gtest(test_${TEST_NAME} + test.cpp + ) + +target_link_libraries(test_${TEST_NAME} + ${catkin_LIBRARIES} + ) + +add_dependencies(test_${TEST_NAME} + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} + ) + +add_rostest(${TEST_NAME}.test) diff --git a/test/vector_converter/test.cpp b/test/vector_converter/test.cpp index 5c4d5a81..b97a4e0a 100644 --- a/test/vector_converter/test.cpp +++ b/test/vector_converter/test.cpp @@ -2,7 +2,7 @@ #pragma GCC diagnostic ignored "-Wnarrowing" #include #pragma GCC diagnostic pop -#include +#include #include #include diff --git a/test/vector_converter/vector_converter.test b/test/vector_converter/vector_converter.test index ccff3290..a2c87c7c 100644 --- a/test/vector_converter/vector_converter.test +++ b/test/vector_converter/vector_converter.test @@ -1,6 +1,16 @@ - + + + + + + + + + + +