Skip to content

Commit

Permalink
Merge pull request #2231 from dzenanz/updateGTest
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Feb 15, 2021
2 parents 74c7480 + bddc08c commit 0a33603
Show file tree
Hide file tree
Showing 31 changed files with 2,220 additions and 4,670 deletions.
2 changes: 1 addition & 1 deletion Modules/ThirdParty/GoogleTest/UpdateFromUpstream.sh
Expand Up @@ -3,7 +3,7 @@
thirdparty_module_name='GoogleTest'

upstream_git_url='https://github.com/google/googletest.git'
upstream_git_branch='release-1.10.0'
upstream_git_branch='master'

github_compare=true

Expand Down
@@ -1,7 +1,7 @@
# Note: CMake support is community-based. The maintainers do not use CMake
# internally.

cmake_minimum_required(VERSION 2.8.8)
cmake_minimum_required(VERSION 2.8.12)

if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
Expand Down
Expand Up @@ -53,7 +53,7 @@ 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 2.8.12)

if (POLICY CMP0063) # Visibility
cmake_policy(SET CMP0063 NEW)
Expand Down Expand Up @@ -126,7 +126,9 @@ 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).
Expand Down Expand Up @@ -182,20 +184,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 @@ -266,6 +254,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 @@ -317,6 +306,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
@@ -1,10 +1,9 @@
prefix=${pcfiledir}/../..
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: gtest
Description: GoogleTest (without main() function)
Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
@@ -1,11 +1,10 @@
prefix=${pcfiledir}/../..
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: gtest_main
Description: GoogleTest (with main() function)
Version: @PROJECT_VERSION@
URL: https://github.com/google/googletest
Requires: gtest
Requires: gtest = @PROJECT_VERSION@
Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
Expand Up @@ -188,6 +188,10 @@ function(cxx_library_with_type name type cxx_flags)
endif()
target_link_libraries(${name} PUBLIC ${threads_spec})
endif()

if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8")
target_compile_features(${name} PUBLIC cxx_std_11)
endif()
endfunction()

########################################################################
Expand Down
Expand Up @@ -190,11 +190,10 @@ GTEST_API_ bool InDeathTestChild();
class GTEST_API_ ExitedWithCode {
public:
explicit ExitedWithCode(int exit_code);
ExitedWithCode(const ExitedWithCode&) = default;
void operator=(const ExitedWithCode& other) = delete;
bool operator()(int exit_status) const;
private:
// No implementation - assignment is unsupported.
void operator=(const ExitedWithCode& other);

const int exit_code_;
};

Expand Down

0 comments on commit 0a33603

Please sign in to comment.