Skip to content

Commit 9be8fb1

Browse files
authored
Update GoogleTest to 1.12.1 (#6)
* wipe old gtest * update GoogleTest to 1.12.1
1 parent a77508a commit 9be8fb1

File tree

156 files changed

+5777
-47347
lines changed

Some content is hidden

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

156 files changed

+5777
-47347
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ PDAL_PYTHON_ADD_PLUGIN(python_filter filter python
201201

202202

203203
if (WITH_TESTS)
204+
set(GOOGLETEST_VERSION 1.12.1)
205+
204206
enable_testing()
205207
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
206208
add_subdirectory(src/pdal/test/gtest)

src/pdal/test/PythonFilterTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ TEST_P(jsonWithProgrammable, pipeline)
11361136
std::cerr << "WARNING: could not create filters.programmable, skipping test" << std::endl;
11371137
}
11381138

1139-
INSTANTIATE_TEST_CASE_P(plugins, jsonWithProgrammable,
1139+
INSTANTIATE_TEST_SUITE_P(plugins, jsonWithProgrammable,
11401140
testing::Values(
11411141
// "pipeline/programmable-hag.json",
11421142
"pipeline/programmable-update-y-dims.json"
@@ -1155,7 +1155,7 @@ TEST_P(jsonWithPredicate, pipeline)
11551155
std::cerr << "WARNING: could not create filters.python, skipping test" << std::endl;
11561156
}
11571157

1158-
INSTANTIATE_TEST_CASE_P(plugins, jsonWithPredicate,
1158+
INSTANTIATE_TEST_SUITE_P(plugins, jsonWithPredicate,
11591159
testing::Values(
11601160
"pipeline/crop_wkt_2d_classification.json",
11611161
"pipeline/from-module.json",

src/pdal/test/gtest/CMakeLists.txt

+19-26
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,9 @@ endif()
4646

4747
# Project version:
4848

49-
set(GOOGLETEST_VERSION "1.10.0")
50-
if (CMAKE_VERSION VERSION_LESS 3.0)
51-
project(gtest CXX C)
52-
set(PROJECT_VERSION ${GOOGLETEST_VERSION})
53-
else()
54-
cmake_policy(SET CMP0048 NEW)
55-
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
56-
endif()
57-
cmake_minimum_required(VERSION 2.6.4)
49+
cmake_minimum_required(VERSION 3.5)
50+
cmake_policy(SET CMP0048 NEW)
51+
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
5852

5953
if (POLICY CMP0063) # Visibility
6054
cmake_policy(SET CMP0063 NEW)
@@ -93,10 +87,13 @@ include(cmake/internal_utils.cmake)
9387

9488
config_compiler_and_linker() # Defined in internal_utils.cmake.
9589

90+
# Needed to set the namespace for both the export targets and the
91+
# alias libraries
92+
set(cmake_package_name GTest CACHE INTERNAL "")
93+
9694
# Create the CMake package file descriptors.
9795
if (INSTALL_GTEST)
9896
include(CMakePackageConfigHelpers)
99-
set(cmake_package_name GTest)
10097
set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "")
10198
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "")
10299
set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}")
@@ -127,18 +124,24 @@ include_directories(${gtest_build_include_dirs})
127124
# are used for other targets, to ensure that gtest can be compiled by a user
128125
# aggressive about warnings.
129126
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
127+
set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION})
130128
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
129+
set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
131130
# If the CMake version supports it, attach header directory information
132131
# to the targets for when we are part of a parent build (ie being pulled
133132
# in via add_subdirectory() rather than being a standalone build).
134133
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
134+
string(REPLACE ";" "$<SEMICOLON>" dirs "${gtest_build_include_dirs}")
135135
target_include_directories(gtest SYSTEM INTERFACE
136-
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
136+
"$<BUILD_INTERFACE:${dirs}>"
137137
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
138138
target_include_directories(gtest_main SYSTEM INTERFACE
139-
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
139+
"$<BUILD_INTERFACE:${dirs}>"
140140
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
141141
endif()
142+
if(CMAKE_SYSTEM_NAME MATCHES "QNX")
143+
target_link_libraries(gtest PUBLIC regex)
144+
endif()
142145
target_link_libraries(gtest_main PUBLIC gtest)
143146

144147
########################################################################
@@ -183,20 +186,6 @@ if (gtest_build_tests)
183186
# 'make test' or ctest.
184187
enable_testing()
185188

186-
if (WIN32)
187-
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1"
188-
CONTENT
189-
"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$<CONFIG>\"
190-
$env:Path = \"$project_bin;$env:Path\"
191-
& $args")
192-
elseif (MINGW OR CYGWIN)
193-
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1"
194-
CONTENT
195-
"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin)
196-
$env:Path = \"$project_bin;$env:Path\"
197-
& $args")
198-
endif()
199-
200189
############################################################
201190
# C++ tests built with standard compiler flags.
202191

@@ -267,6 +256,7 @@ $env:Path = \"$project_bin;$env:Path\"
267256
cxx_executable(googletest-break-on-failure-unittest_ test gtest)
268257
py_test(googletest-break-on-failure-unittest)
269258

259+
py_test(gtest_skip_check_output_test)
270260
py_test(gtest_skip_environment_check_output_test)
271261

272262
# Visual Studio .NET 2003 does not support STL with exceptions disabled.
@@ -318,6 +308,9 @@ $env:Path = \"$project_bin;$env:Path\"
318308
cxx_executable(googletest-uninitialized-test_ test gtest)
319309
py_test(googletest-uninitialized-test)
320310

311+
cxx_executable(gtest_list_output_unittest_ test gtest)
312+
py_test(gtest_list_output_unittest)
313+
321314
cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
322315
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
323316
py_test(gtest_xml_outfiles_test)

src/pdal/test/gtest/CONTRIBUTORS

-37
This file was deleted.

src/pdal/test/gtest/LICENSE

-28
This file was deleted.

0 commit comments

Comments
 (0)