Skip to content
Snippets Groups Projects
Commit 26919e65 authored by Damiano Amatruda's avatar Damiano Amatruda
Browse files

Allow to register Catch2 test cases in CTest

Call to CMake function 'catch_discover_tests' is commented out, as it
makes build machine attempt to run 'catch-tests-entry' at the end of
build phase and fail because it is still cross-compiled.
parent 563acb01
Branches
No related tags found
No related merge requests found
...@@ -88,49 +88,22 @@ sbs_target(test-trace-logger stm32f429zi_stm32f4discovery) ...@@ -88,49 +88,22 @@ sbs_target(test-trace-logger stm32f429zi_stm32f4discovery)
# Tests - Catch # # Tests - Catch #
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
#add_executable(catch-tests-entry src/tests/catch/catch-tests-entry.cpp) add_executable(catch-tests-entry
#target_compile_definitions(catch-tests-entry PUBLIC USE_MOCK_PERIPHERALS) src/tests/catch/catch-tests-entry.cpp
#sbs_target(catch-tests-entry stm32f429zi_stm32f4discovery) src/tests/catch/examples/example-test-factorial.cpp
src/tests/catch/test-aero.cpp
add_executable(example-test-factorial src/tests/catch/examples/example-test-factorial.cpp) src/tests/catch/test-buttonhandler.cpp
target_compile_definitions(example-test-factorial PRIVATE STANDALONE_CATCH1_TEST) src/tests/catch/test-circularbuffer.cpp
sbs_target(example-test-factorial stm32f429zi_stm32f4discovery) src/tests/catch/test-eventbroker.cpp
src/tests/catch/test-hardwaretimer.cpp
add_executable(test-aero src/tests/catch/test-aero.cpp) src/tests/catch/test-kalman-eigen.cpp
target_compile_definitions(test-aero PRIVATE STANDALONE_CATCH1_TEST) src/tests/catch/test-packetqueue.cpp
sbs_target(test-aero stm32f429zi_stm32f4discovery) src/tests/catch/test-sensormanager-catch.cpp
src/tests/catch/xbee/test-xbee-parser.cpp
add_executable(test-buttonhandler src/tests/catch/test-buttonhandler.cpp) )
target_compile_definitions(test-buttonhandler PRIVATE STANDALONE_CATCH1_TEST) target_compile_definitions(catch-tests-entry PUBLIC USE_MOCK_PERIPHERALS)
sbs_target(test-buttonhandler stm32f429zi_stm32f4discovery) sbs_target(catch-tests-entry stm32f429zi_stm32f4discovery)
#catch_discover_tests(catch-tests-entry)
add_executable(test-circularbuffer src/tests/catch/test-circularbuffer.cpp)
target_compile_definitions(test-circularbuffer PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-circularbuffer stm32f429zi_stm32f4discovery)
add_executable(test-eventbroker src/tests/catch/test-eventbroker.cpp)
target_compile_definitions(test-eventbroker PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-eventbroker stm32f429zi_stm32f4discovery)
add_executable(test-hardwaretimer src/tests/catch/test-hardwaretimer.cpp)
target_compile_definitions(test-hardwaretimer PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-hardwaretimer stm32f429zi_stm32f4discovery)
add_executable(test-kalman-eigen src/tests/catch/test-kalman-eigen.cpp)
target_compile_definitions(test-kalman-eigen PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-kalman-eigen stm32f429zi_stm32f4discovery)
add_executable(test-packetqueue src/tests/catch/test-packetqueue.cpp)
target_compile_definitions(test-packetqueue PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-packetqueue stm32f429zi_skyward_death_stack_x)
add_executable(test-sensormanager-catch src/tests/catch/test-sensormanager-catch.cpp)
target_compile_definitions(test-sensormanager-catch PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-sensormanager-catch stm32f429zi_skyward_death_stack_x)
add_executable(test-xbee-parser src/tests/catch/xbee/test-xbee-parser.cpp)
target_compile_definitions(test-xbee-parser PRIVATE STANDALONE_CATCH1_TEST)
sbs_target(test-xbee-parser stm32f429zi_stm32f4discovery)
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# Tests - Drivers # # Tests - Drivers #
......
...@@ -31,7 +31,6 @@ add_subdirectory(${SBS_BASE}/libs/mxgui EXCLUDE_FROM_ALL) ...@@ -31,7 +31,6 @@ add_subdirectory(${SBS_BASE}/libs/mxgui EXCLUDE_FROM_ALL)
add_subdirectory(${SBS_BASE}/libs/tscpp EXCLUDE_FROM_ALL) add_subdirectory(${SBS_BASE}/libs/tscpp EXCLUDE_FROM_ALL)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(BUILD_TESTING OFF CACHE BOOL "Enable creation of Eigen tests.")
set(EIGEN_TEST_NOQT ON CACHE BOOL "Disable Qt support in unit tests") set(EIGEN_TEST_NOQT ON CACHE BOOL "Disable Qt support in unit tests")
set(CMAKE_Fortran_COMPILER NOTFOUND) set(CMAKE_Fortran_COMPILER NOTFOUND)
add_subdirectory(${SBS_BASE}/libs/eigen EXCLUDE_FROM_ALL) add_subdirectory(${SBS_BASE}/libs/eigen EXCLUDE_FROM_ALL)
...@@ -42,5 +41,7 @@ target_compile_definitions(fmt-header-only INTERFACE _GLIBCXX_USE_WCHAR_T FMT_UN ...@@ -42,5 +41,7 @@ target_compile_definitions(fmt-header-only INTERFACE _GLIBCXX_USE_WCHAR_T FMT_UN
target_compile_options(fmt-header-only INTERFACE -fno-math-errno) target_compile_options(fmt-header-only INTERFACE -fno-math-errno)
add_subdirectory(${SBS_BASE}/libs/Catch2 EXCLUDE_FROM_ALL) add_subdirectory(${SBS_BASE}/libs/Catch2 EXCLUDE_FROM_ALL)
list(APPEND CMAKE_MODULE_PATH ${SBS_BASE}/libs/Catch2/contrib)
include(Catch)
add_subdirectory(${SBS_BASE}/libs/mavlink_skyward_lib EXCLUDE_FROM_ALL) add_subdirectory(${SBS_BASE}/libs/mavlink_skyward_lib EXCLUDE_FROM_ALL)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment