add test (doctest)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user