Skip to content

Commit 7cf04fc

Browse files
authored
Update GoogleTest to latest version (#257)
* Remove old gtest version * Add new vendored Googletest version * Move test_config H to HH * CMake updates for new googletest version * Test updates for new googletest version Signed-off-by: Michael Carroll <michael@openrobotics.org>
1 parent 14f6fd3 commit 7cf04fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+11427
-20770
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ find_package(gz-cmake3 REQUIRED)
1414
#============================================================================
1515
# Configure the project
1616
#============================================================================
17+
set(CMAKE_CXX_STANDARD 17)
18+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
19+
1720
gz_configure_project(
1821
REPLACE_IGNITION_INCLUDE_PATH gz/msgs
1922
VERSION_SUFFIX pre1)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ gz_create_core_library(SOURCES
180180
${PROJECT_SOURCE_DIR}/src/Filesystem.cc
181181
${PROJECT_SOURCE_DIR}/src/gz.cc
182182
${PROJECT_SOURCE_DIR}/src/Utility.cc
183-
CXX_STANDARD 17)
183+
)
184184

185185
target_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
186186
PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

src/Factory_TEST.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include <algorithm>
2020
#include <cstddef>
2121

22-
#include "gz/msgs/test_config.h"
2322
#include "gz/msgs/MessageTypes.hh"
2423
#include "gz/msgs/Factory.hh"
24+
#include "test_config.hh"
2525

2626
using namespace gz;
2727

test/CMakeLists.txt

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1+
configure_file (test_config.hh.in
2+
${PROJECT_BINARY_DIR}/include/test_config.hh)
13
include_directories (
2-
${PROJECT_SOURCE_DIR}/test/gtest/include
3-
${PROJECT_SOURCE_DIR}/test/gtest
4-
${PROJECT_SOURCE_DIR}/test
4+
${PROJECT_BINARY_DIR}/include
55
)
66

7-
configure_file (test_config.h.in
8-
${PROJECT_BINARY_DIR}/include/gz/msgs/test_config.h)
9-
10-
# Build gtest
11-
add_library(gtest STATIC gtest/src/gtest-all.cc)
12-
target_compile_features(gtest PUBLIC cxx_variadic_macros)
13-
add_library(gtest_main STATIC gtest/src/gtest_main.cc)
14-
target_link_libraries(gtest_main gtest)
15-
set(GTEST_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest.a")
16-
set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a")
17-
18-
execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results)
19-
execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results)
20-
include_directories(${GTEST_INCLUDE_DIRS})
21-
7+
add_subdirectory(gtest_vendor)
228
add_subdirectory(integration)
239
add_subdirectory(performance)
2410
add_subdirectory(regression)

test/gtest/cmake/internal_utils.cmake

Lines changed: 0 additions & 280 deletions
This file was deleted.

test/gtest/gtest-20180605-98a0d007d70.diff

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)