Fix travis on Windows with gtests.

This commit is contained in:
ArthurSonzogni 2020-04-16 23:36:37 +02:00
parent 76b216dd5e
commit e1782cf9b9
2 changed files with 17 additions and 7 deletions

View File

@ -8,7 +8,7 @@ script:
- cd build
- cmake .. -DFTXUI_BUILD_TESTS=ON
- cmake --build .
- ./tests --gtest_color=yes
- "${FTXUI_TEST_EXE}"
notifications:
email: false
@ -19,14 +19,22 @@ jobs:
- os: linux
dist: bionic
compiler: gcc
env:
- FTXUI_TEST_EXE="./tests --gtest_color=yes"
# Ubuntu
- os: linux
dist: bionic
compiler: clang
env:
- FTXUI_TEST_EXE="./tests --gtest_color=yes"
# OS X
- os: osx
env:
- FTXUI_TEST_EXE="./tests --gtest_color=yes"
# Windows
- os: windows
env:
- FTXUI_TEST_EXE="./Debug/tests.exe --gtest_color=yes"

View File

@ -152,13 +152,14 @@ export(TARGETS screen dom component NAMESPACE ftxui::
if (FTXUI_BUILD_TESTS AND ${CMAKE_VERSION} VERSION_GREATER "3.11.4")
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 master
FetchContent_Declare( googletest
GIT_REPOSITORY "https://github.com/google/googletest"
GIT_TAG release-1.10.0
)
FetchContent_GetProperties(googletest)
@ -185,11 +186,12 @@ if (FTXUI_BUILD_TESTS AND ${CMAKE_VERSION} VERSION_GREATER "3.11.4")
target_link_libraries(tests
PRIVATE component
PRIVATE gtest gtest_main
PRIVATE gtest
PRIVATE gmock
PRIVATE gtest_main
)
set_property(TARGET tests PROPERTY CXX_STANDARD 17)
add_test(tests tests)
endif()
if(FTXUI_BUILD_EXAMPLES)