1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 10:35:10 +00:00
conky/tests/CMakeLists.txt
Brenden Matthews 6c09affaf7 Add some basic unit tests.
Introduced the Catch2 unit testing framework.
2018-12-24 02:02:01 -05:00

48 lines
1.4 KiB
CMake

include(CTest)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${conky_includes})
set(test_srcs "")
if(OS_LINUX)
set(test_srcs ${test_srcs} test-linux.cc)
endif()
if(OS_DARWIN)
set(test_srcs ${test_srcs} test-darwin.cc)
endif()
add_executable(test-conky test-common.cc ${test_srcs})
target_link_libraries(test-conky conky_core)
if(USING_CLANG_7)
set(COVERAGE_LCOV_EXCLUDES
"v1/*"
"/usr/include/**"
"/usr/lib/**"
"/usr/local/include/**"
"/usr/local/lib/**"
"/usr/include/libkern/i386/*"
"/usr/include/sys/_types/*"
"/usr/local/opt/gettext/include/*"
"${CMAKE_CURRENT_SOURCE_DIR}/*"
"${CMAKE_CURRENT_SOURCE_DIR}/catch2/*"
"${CMAKE_SOURCE_DIR}/3rdparty/*")
setup_target_for_coverage_lcov_html(NAME
test-conky-coverage-html
EXECUTABLE
test-conky
DEPENDENCIES
test-conky)
setup_target_for_coverage_lcov_txt(NAME
test-conky-coverage-txt
EXECUTABLE
test-conky
DEPENDENCIES
test-conky)
catch_discover_tests(test-conky)
endif()