add test (doctest)

This commit is contained in:
2024-03-24 15:37:11 +03:00
parent 969429d2f6
commit a963db2900
3 changed files with 83 additions and 13 deletions

View File

@@ -16,6 +16,26 @@ set(ADC_DEVICE_HEADERS
device/adc_device_command.h
)
option(BUILD_TESTS "Buiuld tests" ON)
if (BUILD_TESTS)
find_package(doctest)
set(VALUEHOLDER_TEST_APP adc_valueholder_test)
add_executable(${VALUEHOLDER_TEST_APP} tests/adc_valueholder_test.cpp)
if (NOT doctest_FOUND)
include(FetchContent)
FetchContent_Declare(
doctest
GIT_REPOSITORY https://github.com/doctest/doctest.git
GIT_TAG 2.4.11
)
FetchContent_MakeAvailable(doctest)
endif()
target_link_libraries(${VALUEHOLDER_TEST_APP} PRIVATE doctest::doctest)
endif(BUILD_TESTS)
include(GNUInstallDirs)