2021-06-26 21:14:27 +08:00
|
|
|
enable_testing()
|
|
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
|
|
|
|
|
|
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
|
|
|
|
include(FetchContent)
|
|
|
|
|
|
|
|
FetchContent_Declare( googletest
|
|
|
|
GIT_REPOSITORY "https://github.com/google/googletest"
|
|
|
|
GIT_TAG 23ef29555ef4789f555f1ba8c51b4c52975f0907
|
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
|
|
|
|
add_executable(tests
|
|
|
|
src/ftxui/component/component_test.cpp
|
|
|
|
src/ftxui/component/container_test.cpp
|
|
|
|
src/ftxui/component/input_test.cpp
|
|
|
|
src/ftxui/component/radiobox_test.cpp
|
|
|
|
src/ftxui/component/receiver_test.cpp
|
|
|
|
src/ftxui/component/screen_interactive_test.cpp
|
|
|
|
src/ftxui/component/terminal_input_parser_test.cpp
|
|
|
|
src/ftxui/component/toggle_test.cpp
|
2021-12-12 00:58:25 +08:00
|
|
|
src/ftxui/dom/flexbox_helper_test.cpp
|
|
|
|
src/ftxui/dom/flexbox_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/dom/gauge_test.cpp
|
2021-08-23 01:36:11 +08:00
|
|
|
src/ftxui/dom/gridbox_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/dom/hbox_test.cpp
|
2021-12-12 00:58:25 +08:00
|
|
|
src/ftxui/dom/table_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/dom/text_test.cpp
|
|
|
|
src/ftxui/dom/vbox_test.cpp
|
2021-08-09 05:25:20 +08:00
|
|
|
src/ftxui/screen/string_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(tests
|
|
|
|
PRIVATE component
|
|
|
|
PRIVATE gtest
|
|
|
|
PRIVATE gmock
|
|
|
|
PRIVATE gtest_main
|
|
|
|
)
|
|
|
|
target_include_directories(tests
|
|
|
|
PRIVATE src
|
|
|
|
)
|
|
|
|
target_compile_options(tests PRIVATE -fsanitize=address)
|
|
|
|
target_link_libraries(tests PRIVATE -fsanitize=address)
|
|
|
|
|
|
|
|
if (NOT MSVC)
|
|
|
|
include(cmake/ftxui_benchmark.cmake)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (FTXUI_BUILD_TESTS_FUZZER)
|
|
|
|
include(cmake/ftxui_fuzzer.cmake)
|
|
|
|
endif()
|