mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-07 19:59:25 +00:00
new: tests cmake setup
Signed-off-by: Lorenzo Fontana <lo@linux.com> Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
acae9dd9f1
commit
18b66330ec
24
tests/CMakeLists.txt
Normal file
24
tests/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
set(FALCO_TESTS_SOURCES
|
||||||
|
TestBase.cpp)
|
||||||
|
|
||||||
|
set(FALCO_TESTED_LIBRARIES
|
||||||
|
falco_engine)
|
||||||
|
|
||||||
|
option(FALCO_BUILD_TESTS "Determines whether to build tests." OFF)
|
||||||
|
|
||||||
|
if(FALCO_BUILD_TESTS)
|
||||||
|
enable_testing()
|
||||||
|
if(NOT TARGET catch)
|
||||||
|
include(FindCatch)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(falco_test ${FALCO_TESTS_SOURCES})
|
||||||
|
|
||||||
|
target_link_libraries(falco_test PUBLIC ${FALCO_TESTED_LIBRARIES} catch)
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
include(Catch)
|
||||||
|
catch_discover_tests(falco_test)
|
||||||
|
|
||||||
|
add_custom_target(tests COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS falco_test)
|
||||||
|
endif()
|
Loading…
Reference in New Issue
Block a user