2018-12-23 21:38:00 +00:00
|
|
|
include(CTest)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
|
|
include_directories(${conky_includes})
|
|
|
|
|
2019-03-03 16:45:02 +00:00
|
|
|
set(test_srcs "test-conky.cc")
|
2018-12-23 21:38:00 +00:00
|
|
|
|
|
|
|
if(OS_LINUX)
|
|
|
|
set(test_srcs ${test_srcs} test-linux.cc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(OS_DARWIN)
|
|
|
|
set(test_srcs ${test_srcs} test-darwin.cc)
|
|
|
|
endif()
|
|
|
|
|
2019-06-20 19:51:39 +00:00
|
|
|
set(test_srcs ${test_srcs} test-core.cc)
|
|
|
|
set(test_srcs ${test_srcs} test-diskio.cc)
|
|
|
|
set(test_srcs ${test_srcs} test-fs.cc)
|
2022-10-06 16:06:05 +00:00
|
|
|
set(test_srcs ${test_srcs} test-gradient.cc)
|
2023-02-25 00:31:38 +00:00
|
|
|
set(test_srcs ${test_srcs} test-colours.cc)
|
2019-06-20 19:51:39 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
add_executable(test-conky test-common.cc ${test_srcs})
|
|
|
|
target_link_libraries(test-conky conky_core)
|
2018-12-28 18:26:29 +00:00
|
|
|
catch_discover_tests(test-conky)
|
2018-12-23 21:38:00 +00:00
|
|
|
|
2022-12-26 16:46:29 +00:00
|
|
|
if(CODE_COVERAGE)
|
2018-12-23 21:38:00 +00:00
|
|
|
set(COVERAGE_LCOV_EXCLUDES
|
2019-02-24 20:31:46 +00:00
|
|
|
"*/include/c++/v1/*"
|
|
|
|
"/usr/include/*"
|
|
|
|
"/usr/lib/*"
|
|
|
|
"/usr/local/Cellar/*"
|
|
|
|
"/usr/local/include/*"
|
|
|
|
"/usr/local/lib/*"
|
2018-12-23 21:38:00 +00:00
|
|
|
"/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)
|
|
|
|
endif()
|