2021-06-26 21:14:27 +08:00
|
|
|
enable_testing()
|
|
|
|
|
2022-02-13 17:51:47 +08:00
|
|
|
option(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
|
2022-04-17 21:47:20 +08:00
|
|
|
option(FETCHCONTENT_QUIET FALSE)
|
2021-06-26 21:14:27 +08:00
|
|
|
include(FetchContent)
|
|
|
|
|
2022-01-23 00:58:33 +08:00
|
|
|
FetchContent_Declare(googletest
|
2021-06-26 21:14:27 +08:00
|
|
|
GIT_REPOSITORY "https://github.com/google/googletest"
|
|
|
|
GIT_TAG 23ef29555ef4789f555f1ba8c51b4c52975f0907
|
2022-04-17 21:47:20 +08:00
|
|
|
GIT_PROGRESS TRUE
|
2021-06-26 21:14:27 +08:00
|
|
|
)
|
2022-01-23 00:58:33 +08:00
|
|
|
FetchContent_GetProperties(googletest)
|
|
|
|
if(NOT googletest_POPULATED)
|
|
|
|
FetchContent_Populate(googletest)
|
2022-04-17 21:47:20 +08:00
|
|
|
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
|
|
|
|
)
|
2022-01-23 00:58:33 +08:00
|
|
|
endif()
|
2021-06-26 21:14:27 +08:00
|
|
|
|
|
|
|
add_executable(tests
|
|
|
|
src/ftxui/component/component_test.cpp
|
|
|
|
src/ftxui/component/container_test.cpp
|
|
|
|
src/ftxui/component/input_test.cpp
|
2022-01-07 05:38:32 +08:00
|
|
|
src/ftxui/component/menu_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
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
|
2022-04-26 23:04:34 +08:00
|
|
|
src/ftxui/dom/blink_test.cpp
|
|
|
|
src/ftxui/dom/bold_test.cpp
|
|
|
|
src/ftxui/dom/border_test.cpp
|
|
|
|
src/ftxui/dom/separator_test.cpp
|
|
|
|
src/ftxui/dom/color_test.cpp
|
|
|
|
src/ftxui/dom/dim_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
|
2022-04-26 23:04:34 +08:00
|
|
|
src/ftxui/dom/underlined_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/dom/vbox_test.cpp
|
2022-04-26 23:04:34 +08:00
|
|
|
src/ftxui/screen/color_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 gtest_main
|
|
|
|
)
|
|
|
|
target_include_directories(tests
|
|
|
|
PRIVATE src
|
|
|
|
)
|
2022-04-17 21:47:20 +08:00
|
|
|
ftxui_set_options(tests)
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2022-04-17 21:47:20 +08:00
|
|
|
include(GoogleTest)
|
2022-04-26 23:04:34 +08:00
|
|
|
gtest_discover_tests(tests
|
|
|
|
DISCOVERY_TIMEOUT 600
|
|
|
|
)
|
|
|
|
|
2022-04-17 21:47:20 +08:00
|
|
|
|
|
|
|
include(cmake/ftxui_benchmark.cmake)
|
2021-06-26 21:14:27 +08:00
|
|
|
|
|
|
|
if (FTXUI_BUILD_TESTS_FUZZER)
|
|
|
|
include(cmake/ftxui_fuzzer.cmake)
|
|
|
|
endif()
|