mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Run test on travis.
This commit is contained in:
parent
3cfc208cfe
commit
76b216dd5e
@ -6,8 +6,9 @@ language:
|
|||||||
script:
|
script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake ..
|
- cmake .. -DFTXUI_BUILD_TESTS=ON
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
- ./tests --gtest_color=yes
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@ -5,8 +5,8 @@ project(ftxui
|
|||||||
)
|
)
|
||||||
|
|
||||||
option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" ON)
|
option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" ON)
|
||||||
option(FTXUI_BUILD_TESTS "Set to ON to build tests" ON)
|
|
||||||
option(FTXUI_ENABLE_INSTALL "Generate the install target" ON)
|
option(FTXUI_ENABLE_INSTALL "Generate the install target" ON)
|
||||||
|
option(FTXUI_BUILD_TESTS "Set to ON to build tests" OFF)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
@ -150,10 +150,28 @@ endif()
|
|||||||
export(TARGETS screen dom component NAMESPACE ftxui::
|
export(TARGETS screen dom component NAMESPACE ftxui::
|
||||||
FILE ${PROJECT_BINARY_DIR}/ftxui-targets.cmake)
|
FILE ${PROJECT_BINARY_DIR}/ftxui-targets.cmake)
|
||||||
|
|
||||||
# Note: For gtest, please follow:
|
|
||||||
# https://stackoverflow.com/questions/24295876/cmake-cannot-find-a-googletest-required-library
|
if (FTXUI_BUILD_TESTS AND ${CMAKE_VERSION} VERSION_GREATER "3.11.4")
|
||||||
find_package(GTest)
|
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
|
||||||
if (FTXUI_BUILD_TESTS AND GTEST_FOUND AND THREADS_FOUND)
|
include(FetchContent)
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
googletest
|
||||||
|
GIT_REPOSITORY "https://github.com/google/googletest"
|
||||||
|
GIT_TAG master
|
||||||
|
)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(googletest)
|
||||||
|
if(NOT googletest_POPULATED)
|
||||||
|
message(STATUS "Fetching googletest...")
|
||||||
|
FetchContent_Populate(googletest)
|
||||||
|
message(STATUS "... done")
|
||||||
|
add_subdirectory(
|
||||||
|
${googletest_SOURCE_DIR}
|
||||||
|
${googletest_BINARY_DIR}
|
||||||
|
EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(tests
|
add_executable(tests
|
||||||
src/ftxui/component/toggle_test.cpp
|
src/ftxui/component/toggle_test.cpp
|
||||||
src/ftxui/component/radiobox_test.cpp
|
src/ftxui/component/radiobox_test.cpp
|
||||||
@ -167,15 +185,10 @@ if (FTXUI_BUILD_TESTS AND GTEST_FOUND AND THREADS_FOUND)
|
|||||||
|
|
||||||
target_link_libraries(tests
|
target_link_libraries(tests
|
||||||
PRIVATE component
|
PRIVATE component
|
||||||
PRIVATE Threads::Threads
|
PRIVATE gtest gtest_main
|
||||||
PRIVATE ${GTEST_BOTH_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(tests
|
|
||||||
PRIVATE ${GTest_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
set_property(TARGET tests PROPERTY CXX_STANDARD 17)
|
set_property(TARGET tests PROPERTY CXX_STANDARD 17)
|
||||||
gtest_discover_tests(tests)
|
|
||||||
add_test(tests tests)
|
add_test(tests tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -91,7 +91,6 @@ class ReceiverImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ReleaseSender() {
|
void ReleaseSender() {
|
||||||
std::cerr << __func__ << std::endl;
|
|
||||||
senders_--;
|
senders_--;
|
||||||
notifier_.notify_one();
|
notifier_.notify_one();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user