Skip to content

Commit

Permalink
Update GoogleTest to 1.12.1 (#6)
Browse files Browse the repository at this point in the history
* wipe old gtest

* update GoogleTest to 1.12.1
  • Loading branch information
hobu authored Apr 16, 2024
1 parent a77508a commit 9be8fb1
Show file tree
Hide file tree
Showing 156 changed files with 5,777 additions and 47,347 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ PDAL_PYTHON_ADD_PLUGIN(python_filter filter python


if (WITH_TESTS)
set(GOOGLETEST_VERSION 1.12.1)

enable_testing()
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(src/pdal/test/gtest)
Expand Down
4 changes: 2 additions & 2 deletions src/pdal/test/PythonFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ TEST_P(jsonWithProgrammable, pipeline)
std::cerr << "WARNING: could not create filters.programmable, skipping test" << std::endl;
}

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

INSTANTIATE_TEST_CASE_P(plugins, jsonWithPredicate,
INSTANTIATE_TEST_SUITE_P(plugins, jsonWithPredicate,
testing::Values(
"pipeline/crop_wkt_2d_classification.json",
"pipeline/from-module.json",
Expand Down
45 changes: 19 additions & 26 deletions src/pdal/test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,9 @@ endif()

# Project version:

set(GOOGLETEST_VERSION "1.10.0")
if (CMAKE_VERSION VERSION_LESS 3.0)
project(gtest CXX C)
set(PROJECT_VERSION ${GOOGLETEST_VERSION})
else()
cmake_policy(SET CMP0048 NEW)
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
endif()
cmake_minimum_required(VERSION 2.6.4)
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0048 NEW)
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)

if (POLICY CMP0063) # Visibility
cmake_policy(SET CMP0063 NEW)
Expand Down Expand Up @@ -93,10 +87,13 @@ include(cmake/internal_utils.cmake)

config_compiler_and_linker() # Defined in internal_utils.cmake.

# Needed to set the namespace for both the export targets and the
# alias libraries
set(cmake_package_name GTest CACHE INTERNAL "")

# Create the CMake package file descriptors.
if (INSTALL_GTEST)
include(CMakePackageConfigHelpers)
set(cmake_package_name GTest)
set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "")
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "")
set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}")
Expand Down Expand Up @@ -127,18 +124,24 @@ include_directories(${gtest_build_include_dirs})
# are used for other targets, to ensure that gtest can be compiled by a user
# aggressive about warnings.
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION})
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
# If the CMake version supports it, attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
string(REPLACE ";" "$<SEMICOLON>" dirs "${gtest_build_include_dirs}")
target_include_directories(gtest SYSTEM INTERFACE
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
"$<BUILD_INTERFACE:${dirs}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
target_include_directories(gtest_main SYSTEM INTERFACE
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
"$<BUILD_INTERFACE:${dirs}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "QNX")
target_link_libraries(gtest PUBLIC regex)
endif()
target_link_libraries(gtest_main PUBLIC gtest)

########################################################################
Expand Down Expand Up @@ -183,20 +186,6 @@ if (gtest_build_tests)
# 'make test' or ctest.
enable_testing()

if (WIN32)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1"
CONTENT
"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$<CONFIG>\"
$env:Path = \"$project_bin;$env:Path\"
& $args")
elseif (MINGW OR CYGWIN)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1"
CONTENT
"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin)
$env:Path = \"$project_bin;$env:Path\"
& $args")
endif()

############################################################
# C++ tests built with standard compiler flags.

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

py_test(gtest_skip_check_output_test)
py_test(gtest_skip_environment_check_output_test)

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

cxx_executable(gtest_list_output_unittest_ test gtest)
py_test(gtest_list_output_unittest)

cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
py_test(gtest_xml_outfiles_test)
Expand Down
37 changes: 0 additions & 37 deletions src/pdal/test/gtest/CONTRIBUTORS

This file was deleted.

28 changes: 0 additions & 28 deletions src/pdal/test/gtest/LICENSE

This file was deleted.

Loading

0 comments on commit 9be8fb1

Please sign in to comment.