mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-20 18:48:08 +08:00
Add code coverage support. (#378)
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
enable_testing()
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
option(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
|
||||
option(FETCHCONTENT_QUIET FALSE)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(googletest
|
||||
GIT_REPOSITORY "https://github.com/google/googletest"
|
||||
GIT_TAG 23ef29555ef4789f555f1ba8c51b4c52975f0907
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
FetchContent_GetProperties(googletest)
|
||||
if(NOT googletest_POPULATED)
|
||||
FetchContent_Populate(googletest)
|
||||
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
set(BUILD_GMOCK OFF CACHE INTERNAL "")
|
||||
set(INSTALL_GTEST OFF CACHE INTERNAL "")
|
||||
set(gtest_force_shared_crt ON CACHE INTERNAL "")
|
||||
add_subdirectory(
|
||||
${googletest_SOURCE_DIR}
|
||||
${googletest_BINARY_DIR}
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(tests
|
||||
@@ -38,16 +46,17 @@ add_executable(tests
|
||||
target_link_libraries(tests
|
||||
PRIVATE component
|
||||
PRIVATE gtest
|
||||
PRIVATE gmock
|
||||
PRIVATE gtest_main
|
||||
)
|
||||
target_include_directories(tests
|
||||
PRIVATE src
|
||||
)
|
||||
ftxui_set_options(tests)
|
||||
|
||||
if (NOT MSVC)
|
||||
include(cmake/ftxui_benchmark.cmake)
|
||||
endif()
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(tests)
|
||||
|
||||
include(cmake/ftxui_benchmark.cmake)
|
||||
|
||||
if (FTXUI_BUILD_TESTS_FUZZER)
|
||||
include(cmake/ftxui_fuzzer.cmake)
|
||||
|
Reference in New Issue
Block a user