Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtest: add submodule #9715

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
path = external/supercop
url = https://github.com/monero-project/supercop
branch = monero
[submodule "external/gtest"]
path = external/gtest
url = https://github.com/google/googletest.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ sudo apt update && sudo apt install build-essential cmake pkg-config libssl-dev

Install all dependencies at once on Arch:
```
sudo pacman -Syu --needed base-devel cmake boost openssl zeromq unbound libsodium libunwind xz readline expat gtest python3 ccache doxygen graphviz qt5-tools hidapi libusb protobuf systemd
sudo pacman -Syu --needed base-devel cmake boost openssl zeromq unbound libsodium libunwind xz readline expat python3 ccache doxygen graphviz qt5-tools hidapi libusb protobuf systemd
```

Install all dependencies at once on Fedora:
```
sudo dnf install gcc gcc-c++ cmake pkgconf boost-devel openssl-devel zeromq-devel unbound-devel libsodium-devel libunwind-devel xz-devel readline-devel expat-devel gtest-devel ccache doxygen graphviz qt5-linguist hidapi-devel libusbx-devel protobuf-devel protobuf-compiler systemd-devel
sudo dnf install gcc gcc-c++ cmake pkgconf boost-devel openssl-devel zeromq-devel unbound-devel libsodium-devel libunwind-devel xz-devel readline-devel expat-devel ccache doxygen graphviz qt5-linguist hidapi-devel libusbx-devel protobuf-devel protobuf-compiler systemd-devel
```

Install all dependencies at once on openSUSE:
Expand Down
39 changes: 0 additions & 39 deletions contrib/depends/packages/gtest.mk

This file was deleted.

4 changes: 0 additions & 4 deletions contrib/depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ ifneq ($(host_os),mingw32)
packages += ncurses readline
endif

ifeq ($(build_tests),ON)
packages += gtest
endif

linux_native_packages :=
linux_packages := eudev

Expand Down
1 change: 1 addition & 0 deletions external/gtest
Submodule gtest added at b514bd
36 changes: 5 additions & 31 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,11 @@ if (WIN32 AND STATIC)
add_definitions(-DMINIUPNP_STATICLIB)
endif ()

find_package(GTest)

if (GTest_FOUND)
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
else ()
message(STATUS "GTest not found on the system: will use GTest bundled with this source")

include(ExternalProject)
ExternalProject_Add(googletest
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gtest
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gtest
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
add_library(gtest UNKNOWN IMPORTED)
add_library(gtest_main UNKNOWN IMPORTED)
set_target_properties(gtest PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
set_target_properties(gtest_main PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
add_dependencies(gtest googletest)
add_dependencies(gtest_main googletest)

# Emulate the FindGTest module's variable.
set(GTEST_LIBRARIES gtest gtest_main)
set(GTEST_BOTH_LIBRARIES gtest gtest_main)
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest/include")
endif (GTest_FOUND)
set(BUILD_GMOCK OFF CACHE BOOL "Don't build GMock" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "Don't install GTest" FORCE)
add_subdirectory("${CMAKE_SOURCE_DIR}/external/gtest" ${CMAKE_BINARY_DIR}/googletest)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/external/gtest/googletest/include")
set(GTEST_LIBRARIES gtest gtest_main)

message(STATUS "Copying test data directory...")
file(COPY data DESTINATION .) # Copy data directory from source root to build root
Expand Down
157 changes: 0 additions & 157 deletions tests/gtest/CHANGES

This file was deleted.

Loading
Loading