2023-05-29 21:30:02 +08:00
|
|
|
if (NOT FTXUI_BUILD_TESTS)
|
2023-01-15 03:37:42 +08:00
|
|
|
return()
|
|
|
|
endif()
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2023-01-15 03:37:42 +08:00
|
|
|
enable_testing()
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2023-01-15 03:37:42 +08:00
|
|
|
include(cmake/ftxui_find_google_test.cmake)
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2023-01-15 03:37:42 +08:00
|
|
|
add_executable(ftxui-tests
|
2022-04-27 17:33:42 +08:00
|
|
|
src/ftxui/component/animation_test.cpp
|
2022-04-28 16:08:33 +08:00
|
|
|
src/ftxui/component/button_test.cpp
|
|
|
|
src/ftxui/component/collapsible_test.cpp
|
2022-04-27 17:33:42 +08:00
|
|
|
src/ftxui/component/component_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/component/component_test.cpp
|
|
|
|
src/ftxui/component/container_test.cpp
|
2022-12-04 18:54:49 +08:00
|
|
|
src/ftxui/component/hoverable_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/component/input_test.cpp
|
2022-01-07 05:38:32 +08:00
|
|
|
src/ftxui/component/menu_test.cpp
|
2022-06-12 23:08:22 +08:00
|
|
|
src/ftxui/component/modal_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/component/radiobox_test.cpp
|
2024-05-16 00:23:59 +08:00
|
|
|
src/ftxui/util/ref_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/component/receiver_test.cpp
|
2022-04-28 16:08:33 +08:00
|
|
|
src/ftxui/component/resizable_split_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
src/ftxui/component/screen_interactive_test.cpp
|
2022-12-04 18:54:49 +08:00
|
|
|
src/ftxui/component/slider_test.cpp
|
2021-06-26 21:14:27 +08:00
|
|
|
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
|
2022-04-27 00:00:05 +08:00
|
|
|
src/ftxui/dom/canvas_test.cpp
|
2022-04-26 23:04:34 +08:00
|
|
|
src/ftxui/dom/color_test.cpp
|
2022-04-27 20:00:46 +08:00
|
|
|
src/ftxui/dom/dbox_test.cpp
|
2022-04-26 23:04:34 +08:00
|
|
|
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
|
2023-06-05 03:06:19 +08:00
|
|
|
src/ftxui/dom/hyperlink_test.cpp
|
2023-03-22 20:59:02 +08:00
|
|
|
src/ftxui/dom/linear_gradient_test.cpp
|
2022-04-27 20:00:46 +08:00
|
|
|
src/ftxui/dom/scroll_indicator_test.cpp
|
|
|
|
src/ftxui/dom/separator_test.cpp
|
|
|
|
src/ftxui/dom/spinner_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
|
|
|
)
|
|
|
|
|
2023-01-15 03:37:42 +08:00
|
|
|
target_link_libraries(ftxui-tests
|
2021-06-26 21:14:27 +08:00
|
|
|
PRIVATE component
|
2023-01-15 03:37:42 +08:00
|
|
|
PRIVATE GTest::gtest
|
|
|
|
PRIVATE GTest::gtest_main
|
2021-06-26 21:14:27 +08:00
|
|
|
)
|
2023-01-15 03:37:42 +08:00
|
|
|
target_include_directories(ftxui-tests
|
2021-06-26 21:14:27 +08:00
|
|
|
PRIVATE src
|
|
|
|
)
|
2023-05-26 01:34:34 +08:00
|
|
|
target_compile_features(ftxui-tests PRIVATE cxx_std_20)
|
2023-03-31 23:13:48 +08:00
|
|
|
|
2023-08-29 03:38:51 +08:00
|
|
|
# Disable unity build for tests. There are several files defining the same
|
|
|
|
# function in different anonymous namespaces. This is not allowed in unity
|
|
|
|
# builds, as it would result in multiple definitions of the same function.
|
|
|
|
set_target_properties(ftxui-tests PROPERTIES UNITY_BUILD OFF)
|
|
|
|
|
2023-03-31 23:13:48 +08:00
|
|
|
if (FTXUI_MICROSOFT_TERMINAL_FALLBACK)
|
|
|
|
target_compile_definitions(ftxui-tests
|
|
|
|
PRIVATE "FTXUI_MICROSOFT_TERMINAL_FALLBACK")
|
|
|
|
endif()
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2022-04-17 21:47:20 +08:00
|
|
|
include(GoogleTest)
|
2023-01-15 03:37:42 +08:00
|
|
|
gtest_discover_tests(ftxui-tests
|
2022-04-26 23:04:34 +08:00
|
|
|
DISCOVERY_TIMEOUT 600
|
|
|
|
)
|
2023-05-02 19:32:37 +08:00
|
|
|
|
2023-06-25 23:22:05 +08:00
|
|
|
#set(CMAKE_CTEST_ARGUMENTS "--rerun-failed --output-on-failure")
|
|
|
|
#set_tests_properties(gen_init_queries PROPERTIES FIXTURES_SETUP f_init_queries)
|
|
|
|
#set_tests_properties(test PROPERTIES FIXTURES_REQUIRED f_init_queries)
|