Skip to content

Commit

Permalink
Update GoogleTest to latest version (#63)
Browse files Browse the repository at this point in the history
* Remove old gtest version
* Add new vendored Googletest version
* Move test_config H to HH
* CMake updates for new googletest version

Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Jun 28, 2022
1 parent 99acf96 commit 6d6084e
Show file tree
Hide file tree
Showing 58 changed files with 11,427 additions and 20,770 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ find_package(gz-cmake3 REQUIRED)
#============================================================================
# Configure the project
#============================================================================
set(c++standard 17)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/utils
VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
#============================================================================

option(
IGN_UTILS_VENDOR_CLI11
"If true, use the vendored version of CLI11, otherwise use an external one"
Expand Down
23 changes: 3 additions & 20 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
configure_file (test_config.h.in ${PROJECT_BINARY_DIR}/test_config.h)
configure_file (test_config.hh.in
${PROJECT_BINARY_DIR}/include/test_config.hh)
include_directories (
${PROJECT_BINARY_DIR}/include
)

# Build gtest
add_library(gtest STATIC gtest/src/gtest-all.cc)
add_library(gtest_main STATIC gtest/src/gtest_main.cc)
target_include_directories(gtest
SYSTEM PUBLIC
${PROJECT_SOURCE_DIR}/test/gtest/include
${PROJECT_SOURCE_DIR}/test/gtest
)

target_link_libraries(gtest_main gtest)
set_property(TARGET gtest_main PROPERTY CXX_STANDARD ${c++standard})
set_property(TARGET gtest PROPERTY CXX_STANDARD ${c++standard})
set(GTEST_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest.a")
set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a")

execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results)
execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results)

#============================================================================
# Do a fake install of ign-utils in order to test the examples.
#============================================================================
set(FAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/fake/install")

file(MAKE_DIRECTORY ${FAKE_INSTALL_PREFIX})

include(ExternalProject)
Expand All @@ -42,6 +24,7 @@ ExternalProject_Add(
"-DCMAKE_INSTALL_PREFIX=${FAKE_INSTALL_PREFIX}"
)

add_subdirectory(gtest_vendor)
add_subdirectory(integration)
add_subdirectory(performance)
add_subdirectory(regression)
280 changes: 0 additions & 280 deletions test/gtest/cmake/internal_utils.cmake

This file was deleted.

28 changes: 0 additions & 28 deletions test/gtest/gtest-20180605-98a0d007d70.diff

This file was deleted.

Loading

0 comments on commit 6d6084e

Please sign in to comment.