aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-09-08 03:45:23 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-09-08 03:45:23 +0000
commit4613b2e6c4e0415132e79b4af9ba140285b1623a (patch)
treea0bcf14cdb783388af4a74dd8036a91256e5ba40
parent1f290ff54290d8afb154b26b4be82b9d8042f828 (diff)
parente1cc656c378c9efc09796fc4c742d706657e8a5c (diff)
downloadgoogletest-mirror-goog-studio-master-dev.tar.gz
Snap for 4999818 from e1cc656c378c9efc09796fc4c742d706657e8a5c to studio-3.2-releasestudio-3.2.1mirror-goog-studio-master-dev
Change-Id: Ia9571b460077d90727fc25551348ac7ca31f8b0f
-rw-r--r--.gitignore11
-rw-r--r--.travis.yml6
-rw-r--r--CMakeLists.txt22
-rw-r--r--CONTRIBUTING.md8
-rw-r--r--METADATA6
-rw-r--r--README.md8
-rwxr-xr-xci/env-linux.sh2
-rwxr-xr-xci/env-osx.sh2
-rwxr-xr-xci/install-linux.sh2
-rw-r--r--googlemock/CMakeLists.txt69
-rw-r--r--googlemock/README.md21
-rw-r--r--googlemock/docs/ForDummies.md2
-rw-r--r--googlemock/docs/FrequentlyAskedQuestions.md2
-rw-r--r--googlemock/include/gmock/gmock-actions.h5
-rw-r--r--googlemock/include/gmock/gmock-cardinalities.h10
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h20
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h.pump8
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h5
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h.pump7
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h6
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h.pump5
-rw-r--r--googlemock/include/gmock/gmock-generated-nice-strict.h5
-rw-r--r--googlemock/include/gmock/gmock-generated-nice-strict.h.pump5
-rw-r--r--googlemock/include/gmock/gmock-matchers.h87
-rw-r--r--googlemock/include/gmock/gmock-more-actions.h5
-rw-r--r--googlemock/include/gmock/gmock-more-matchers.h11
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h24
-rw-r--r--googlemock/include/gmock/gmock.h5
-rw-r--r--googlemock/include/gmock/internal/custom/README.md16
-rw-r--r--googlemock/include/gmock/internal/custom/gmock-generated-actions.h2
-rw-r--r--googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump2
-rw-r--r--googlemock/include/gmock/internal/custom/gmock-matchers.h6
-rw-r--r--googlemock/include/gmock/internal/custom/gmock-port.h13
-rw-r--r--googlemock/include/gmock/internal/gmock-generated-internal-utils.h5
-rw-r--r--googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump5
-rw-r--r--googlemock/include/gmock/internal/gmock-internal-utils.h7
-rw-r--r--googlemock/include/gmock/internal/gmock-port.h5
-rwxr-xr-xgooglemock/scripts/generator/cpp/ast.py3
-rwxr-xr-xgooglemock/scripts/generator/cpp/gmock_class_test.py18
-rwxr-xr-xgooglemock/scripts/upload.py8
-rw-r--r--googlemock/src/gmock-all.cc3
-rw-r--r--googlemock/src/gmock-cardinalities.cc3
-rw-r--r--googlemock/src/gmock-internal-utils.cc3
-rw-r--r--googlemock/src/gmock-matchers.cc3
-rw-r--r--googlemock/src/gmock-spec-builders.cc7
-rw-r--r--googlemock/src/gmock.cc5
-rw-r--r--googlemock/src/gmock_main.cc6
-rw-r--r--googlemock/test/gmock-actions_test.cc5
-rw-r--r--googlemock/test/gmock-cardinalities_test.cc3
-rw-r--r--googlemock/test/gmock-generated-actions_test.cc3
-rw-r--r--googlemock/test/gmock-generated-function-mockers_test.cc3
-rw-r--r--googlemock/test/gmock-generated-internal-utils_test.cc3
-rw-r--r--googlemock/test/gmock-internal-utils_test.cc3
-rw-r--r--googlemock/test/gmock-matchers_test.cc21
-rw-r--r--googlemock/test/gmock-more-actions_test.cc3
-rw-r--r--googlemock/test/gmock-nice-strict_test.cc3
-rw-r--r--googlemock/test/gmock-port_test.cc3
-rw-r--r--googlemock/test/gmock-spec-builders_test.cc5
-rw-r--r--googlemock/test/gmock_all_test.cc3
-rw-r--r--googlemock/test/gmock_ex_test.cc3
-rwxr-xr-xgooglemock/test/gmock_leak_test.py4
-rw-r--r--googlemock/test/gmock_leak_test_.cc3
-rw-r--r--googlemock/test/gmock_link2_test.cc3
-rw-r--r--googlemock/test/gmock_link_test.cc3
-rw-r--r--googlemock/test/gmock_link_test.h3
-rwxr-xr-xgooglemock/test/gmock_output_test.py8
-rw-r--r--googlemock/test/gmock_output_test_.cc3
-rw-r--r--googlemock/test/gmock_stress_test.cc6
-rw-r--r--googlemock/test/gmock_test.cc3
-rwxr-xr-xgooglemock/test/gmock_test_utils.py2
-rw-r--r--googletest/Android.bp2
-rw-r--r--googletest/Android.mk26
-rw-r--r--googletest/CMakeLists.txt165
-rw-r--r--googletest/Makefile.am52
-rw-r--r--googletest/cmake/Config.cmake.in9
-rw-r--r--googletest/cmake/internal_utils.cmake46
-rw-r--r--googletest/docs/XcodeGuide.md8
-rw-r--r--googletest/docs/advanced.md132
-rw-r--r--googletest/docs/faq.md11
-rw-r--r--googletest/docs/primer.md8
-rw-r--r--googletest/include/gtest/gtest-death-test.h8
-rw-r--r--googletest/include/gtest/gtest-message.h10
-rw-r--r--googletest/include/gtest/gtest-param-test.h40
-rw-r--r--googletest/include/gtest/gtest-param-test.h.pump3
-rw-r--r--googletest/include/gtest/gtest-printers.h16
-rw-r--r--googletest/include/gtest/gtest-spi.h10
-rw-r--r--googletest/include/gtest/gtest-test-part.h10
-rw-r--r--googletest/include/gtest/gtest-typed-test.h110
-rw-r--r--googletest/include/gtest/gtest.h22
-rw-r--r--googletest/include/gtest/gtest_pred_impl.h2
-rw-r--r--googletest/include/gtest/gtest_prod.h4
-rw-r--r--googletest/include/gtest/internal/custom/README.md56
-rw-r--r--googletest/include/gtest/internal/custom/gtest-port.h35
-rw-r--r--googletest/include/gtest/internal/custom/gtest-printers.h4
-rw-r--r--googletest/include/gtest/internal/custom/gtest.h10
-rw-r--r--googletest/include/gtest/internal/gtest-death-test-internal.h7
-rw-r--r--googletest/include/gtest/internal/gtest-filepath.h8
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h97
-rw-r--r--googletest/include/gtest/internal/gtest-linked_ptr.h6
-rw-r--r--googletest/include/gtest/internal/gtest-param-util-generated.h417
-rw-r--r--googletest/include/gtest/internal/gtest-param-util-generated.h.pump7
-rw-r--r--googletest/include/gtest/internal/gtest-param-util.h5
-rw-r--r--googletest/include/gtest/internal/gtest-port.h47
-rw-r--r--googletest/include/gtest/internal/gtest-string.h6
-rw-r--r--googletest/include/gtest/internal/gtest-tuple.h7
-rw-r--r--googletest/include/gtest/internal/gtest-tuple.h.pump7
-rw-r--r--googletest/include/gtest/internal/gtest-type-util.h5
-rw-r--r--googletest/include/gtest/internal/gtest-type-util.h.pump5
-rw-r--r--googletest/samples/prime_tables.h5
-rw-r--r--googletest/samples/sample1.cc2
-rw-r--r--googletest/samples/sample1.h2
-rw-r--r--googletest/samples/sample10_unittest.cc3
-rw-r--r--googletest/samples/sample1_unittest.cc3
-rw-r--r--googletest/samples/sample2.cc2
-rw-r--r--googletest/samples/sample2.h2
-rw-r--r--googletest/samples/sample2_unittest.cc3
-rw-r--r--googletest/samples/sample3-inl.h2
-rw-r--r--googletest/samples/sample3_unittest.cc3
-rw-r--r--googletest/samples/sample4.cc12
-rw-r--r--googletest/samples/sample4.h6
-rw-r--r--googletest/samples/sample4_unittest.cc8
-rw-r--r--googletest/samples/sample5_unittest.cc3
-rw-r--r--googletest/samples/sample6_unittest.cc3
-rw-r--r--googletest/samples/sample7_unittest.cc3
-rw-r--r--googletest/samples/sample8_unittest.cc3
-rw-r--r--googletest/samples/sample9_unittest.cc3
-rwxr-xr-xgoogletest/scripts/upload.py8
-rw-r--r--googletest/src/gtest-all.cc3
-rw-r--r--googletest/src/gtest-death-test.cc83
-rw-r--r--googletest/src/gtest-filepath.cc4
-rw-r--r--googletest/src/gtest-internal-inl.h12
-rw-r--r--googletest/src/gtest-port.cc61
-rw-r--r--googletest/src/gtest-printers.cc5
-rw-r--r--googletest/src/gtest-test-part.cc3
-rw-r--r--googletest/src/gtest-typed-test.cc3
-rw-r--r--googletest/src/gtest.cc287
-rw-r--r--googletest/src/gtest_main.cc3
-rw-r--r--googletest/test/BUILD.bazel257
-rwxr-xr-xgoogletest/test/googletest-break-on-failure-unittest.py (renamed from googletest/test/gtest_break_on_failure_unittest.py)10
-rw-r--r--googletest/test/googletest-break-on-failure-unittest_.cc (renamed from googletest/test/gtest_break_on_failure_unittest_.cc)3
-rwxr-xr-xgoogletest/test/googletest-catch-exceptions-test.py (renamed from googletest/test/gtest_catch_exceptions_test.py)14
-rw-r--r--googletest/test/googletest-catch-exceptions-test_.cc (renamed from googletest/test/gtest_catch_exceptions_test_.cc)10
-rwxr-xr-xgoogletest/test/googletest-color-test.py (renamed from googletest/test/gtest_color_test.py)6
-rw-r--r--googletest/test/googletest-color-test_.cc (renamed from googletest/test/gtest_color_test_.cc)3
-rw-r--r--googletest/test/googletest-death-test-test.cc (renamed from googletest/test/gtest-death-test_test.cc)7
-rw-r--r--googletest/test/googletest-death-test_ex_test.cc (renamed from googletest/test/gtest-death-test_ex_test.cc)5
-rwxr-xr-xgoogletest/test/googletest-env-var-test.py (renamed from googletest/test/gtest_env_var_test.py)6
-rw-r--r--googletest/test/googletest-env-var-test_.cc (renamed from googletest/test/gtest_env_var_test_.cc)8
-rw-r--r--googletest/test/googletest-filepath-test.cc (renamed from googletest/test/gtest-filepath_test.cc)3
-rwxr-xr-xgoogletest/test/googletest-filter-unittest.py (renamed from googletest/test/gtest_filter_unittest.py)14
-rw-r--r--googletest/test/googletest-filter-unittest_.cc (renamed from googletest/test/gtest_filter_unittest_.cc)3
-rw-r--r--googletest/test/googletest-json-outfiles-test.py (renamed from googletest/test/gtest_json_outfiles_test.py)4
-rw-r--r--googletest/test/googletest-json-output-unittest.py (renamed from googletest/test/gtest_json_output_unittest.py)9
-rw-r--r--googletest/test/googletest-linked-ptr-test.cc (renamed from googletest/test/gtest-linked_ptr_test.cc)7
-rwxr-xr-xgoogletest/test/googletest-list-tests-unittest.py (renamed from googletest/test/gtest_list_tests_unittest.py)16
-rw-r--r--googletest/test/googletest-list-tests-unittest_.cc (renamed from googletest/test/gtest_list_tests_unittest_.cc)3
-rw-r--r--googletest/test/googletest-listener-test.cc (renamed from googletest/test/gtest-listener_test.cc)6
-rw-r--r--googletest/test/googletest-message-test.cc (renamed from googletest/test/gtest-message_test.cc)3
-rw-r--r--googletest/test/googletest-options-test.cc (renamed from googletest/test/gtest-options_test.cc)8
-rw-r--r--googletest/test/googletest-output-test-golden-lin.txt (renamed from googletest/test/gtest_output_test_golden_lin.txt)264
-rwxr-xr-xgoogletest/test/googletest-output-test.py (renamed from googletest/test/gtest_output_test.py)27
-rw-r--r--googletest/test/googletest-output-test_.cc (renamed from googletest/test/gtest_output_test_.cc)50
-rw-r--r--googletest/test/googletest-param-test-invalid-name1-test.py63
-rw-r--r--googletest/test/googletest-param-test-invalid-name1-test_.cc50
-rw-r--r--googletest/test/googletest-param-test-invalid-name2-test.py62
-rw-r--r--googletest/test/googletest-param-test-invalid-name2-test_.cc55
-rw-r--r--googletest/test/googletest-param-test-test.cc (renamed from googletest/test/gtest-param-test_test.cc)7
-rw-r--r--googletest/test/googletest-param-test-test.h (renamed from googletest/test/gtest-param-test_test.h)2
-rw-r--r--googletest/test/googletest-param-test2-test.cc (renamed from googletest/test/gtest-param-test2_test.cc)18
-rw-r--r--googletest/test/googletest-port-test.cc (renamed from googletest/test/gtest-port_test.cc)13
-rw-r--r--googletest/test/googletest-printers-test.cc (renamed from googletest/test/gtest-printers_test.cc)27
-rwxr-xr-xgoogletest/test/googletest-shuffle-test.py (renamed from googletest/test/gtest_shuffle_test.py)8
-rw-r--r--googletest/test/googletest-shuffle-test_.cc (renamed from googletest/test/gtest_shuffle_test_.cc)3
-rw-r--r--googletest/test/googletest-test-part-test.cc (renamed from googletest/test/gtest-test-part_test.cc)5
-rw-r--r--googletest/test/googletest-test2_test.cc61
-rwxr-xr-xgoogletest/test/googletest-throw-on-failure-test.py (renamed from googletest/test/gtest_throw_on_failure_test.py)14
-rw-r--r--googletest/test/googletest-throw-on-failure-test_.cc (renamed from googletest/test/gtest_throw_on_failure_test_.cc)5
-rw-r--r--googletest/test/googletest-tuple-test.cc (renamed from googletest/test/gtest-tuple_test.cc)3
-rwxr-xr-xgoogletest/test/googletest-uninitialized-test.py (renamed from googletest/test/gtest_uninitialized_test.py)4
-rw-r--r--googletest/test/googletest-uninitialized-test_.cc (renamed from googletest/test/gtest_uninitialized_test_.cc)3
-rw-r--r--googletest/test/gtest-typed-test2_test.cc5
-rw-r--r--googletest/test/gtest-typed-test_test.cc87
-rw-r--r--googletest/test/gtest-typed-test_test.h3
-rw-r--r--googletest/test/gtest-unittest-api_test.cc3
-rw-r--r--googletest/test/gtest_all_test.cc27
-rw-r--r--googletest/test/gtest_assert_by_exception_test.cc5
-rw-r--r--googletest/test/gtest_environment_test.cc3
-rwxr-xr-xgoogletest/test/gtest_help_test.py2
-rw-r--r--googletest/test/gtest_help_test_.cc3
-rw-r--r--googletest/test/gtest_list_output_unittest.py141
-rw-r--r--googletest/test/gtest_list_output_unittest_.cc51
-rw-r--r--googletest/test/gtest_main_unittest.cc3
-rw-r--r--googletest/test/gtest_no_test_unittest.cc2
-rw-r--r--googletest/test/gtest_premature_exit_test.cc3
-rw-r--r--googletest/test/gtest_prod_test.cc5
-rw-r--r--googletest/test/gtest_repeat_test.cc6
-rw-r--r--googletest/test/gtest_sole_header_test.cc3
-rw-r--r--googletest/test/gtest_stress_test.cc3
-rw-r--r--googletest/test/gtest_test_macro_stack_footprint_test.cc89
-rwxr-xr-xgoogletest/test/gtest_test_utils.py12
-rwxr-xr-x[-rw-r--r--]googletest/test/gtest_testbridge_test.py2
-rw-r--r--googletest/test/gtest_testbridge_test_.cc3
-rw-r--r--googletest/test/gtest_throw_on_failure_ex_test.cc3
-rw-r--r--googletest/test/gtest_unittest.cc22
-rw-r--r--googletest/test/gtest_xml_outfile1_test_.cc1
-rw-r--r--googletest/test/gtest_xml_outfile2_test_.cc1
-rwxr-xr-xgoogletest/test/gtest_xml_outfiles_test.py4
-rw-r--r--googletest/test/production.cc3
-rw-r--r--googletest/test/production.h3
-rw-r--r--googletest/xcode/Config/DebugProject.xcconfig2
-rw-r--r--googletest/xcode/Config/FrameworkTarget.xcconfig2
-rw-r--r--googletest/xcode/Config/General.xcconfig2
-rw-r--r--googletest/xcode/Config/ReleaseProject.xcconfig2
-rw-r--r--googletest/xcode/Config/StaticLibraryTarget.xcconfig2
214 files changed, 2905 insertions, 1303 deletions
diff --git a/.gitignore b/.gitignore
index 16c56e68..73cdd2c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,14 @@ googletest/fused-src/
# macOS files
.DS_Store
+
+# Ignore cmake generated directories and files.
+CMakeFiles
+CTestTestfile.cmake
+Makefile
+cmake_install.cmake
+googlemock/CMakeFiles
+googlemock/CTestTestfile.cmake
+googlemock/Makefile
+googlemock/cmake_install.cmake
+googlemock/gtest
diff --git a/.travis.yml b/.travis.yml
index 1200c676..4e7413a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
# Build matrix / environment variable are explained on:
-# http://about.travis-ci.org/docs/user/build-configuration/
+# https://docs.travis-ci.com/user/customizing-the-build/
# This file can be validated on:
# http://lint.travis-ci.org/
@@ -72,10 +72,10 @@ addons:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
sources:
- ubuntu-toolchain-r-test
- - llvm-toolchain-precise-3.7
+ - llvm-toolchain-precise-3.9
packages:
- g++-4.9
- - clang-3.7
+ - clang-3.9
notifications:
email: false
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8a97faa..d7732116 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,33 +1,23 @@
-cmake_minimum_required(VERSION 2.6.4)
+cmake_minimum_required(VERSION 2.8.8)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)
-project( googletest-distribution )
+project(googletest-distribution)
+set(GOOGLETEST_VERSION 1.9.0)
enable_testing()
include(CMakeDependentOption)
-if (CMAKE_VERSION VERSION_LESS 2.8.5)
- set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)")
- set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)")
- set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)")
- mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR)
-else()
- include(GNUInstallDirs)
-endif()
-
-option(BUILD_GTEST "Builds the googletest subproject" OFF)
+include(GNUInstallDirs)
#Note that googlemock target already builds googletest
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
-
-cmake_dependent_option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF)
-cmake_dependent_option(INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF)
+option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
if(BUILD_GMOCK)
add_subdirectory( googlemock )
-elseif(BUILD_GTEST)
+else()
add_subdirectory( googletest )
endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ebdfcc6..846dd8ab 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -19,6 +19,10 @@ Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.
+## Are you a Googler?
+If you are a Googler, you can either create an internal change or work on GitHub directly.
+
+
## Contributing A Patch
1. Submit an issue describing your proposed change to the
@@ -39,10 +43,6 @@ accept your pull requests.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a pull request.
-If you are a Googler, it is preferable to first create an internal change and
-have it reviewed and submitted, and then create an upstreaming pull
-request here.
-
## The Google Test and Google Mock Communities ##
The Google Test community exists primarily through the
diff --git a/METADATA b/METADATA
index 489daad4..1d1845f6 100644
--- a/METADATA
+++ b/METADATA
@@ -9,10 +9,10 @@ third_party {
type: GIT
value: "https://github.com/google/googletest.git"
}
- version: "41f0e24335d8874cc87420a6349bb1844e2a15de"
+ version: "2fe3bd994b3189899d93f1d5a881e725e046fdc2"
last_upgrade_date {
year: 2018
- month: 7
- day: 11
+ month: 9
+ day: 1
}
}
diff --git a/README.md b/README.md
index d87abce0..fe569414 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,12 @@
[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest)
[![Build status](https://ci.appveyor.com/api/projects/status/4o38plt0xbo1ubc8/branch/master?svg=true)](https://ci.appveyor.com/project/GoogleTestAppVeyor/googletest/branch/master)
+**Future Plans**:
+* 1.8.x Release - the 1.8.x will be the last release that works with pre-C++11 compilers. The 1.8.x will not accept any requests for any new features and any bugfix requests will only be accepted if proven "critical"
+* Post 1.8.x - work to improve/cleanup/pay technical debt. When this work is completed there will be a 1.9.x tagged release
+* Post 1.9.x googletest will follow [Abseil Live at Head philosophy](https://abseil.io/about/philosophy)
+
+
Welcome to **Google Test**, Google's C++ test framework!
This repository is a merger of the formerly separate GoogleTest and
@@ -79,6 +85,8 @@ result output. If your test runner understands TAP, you may find it useful.
[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that
runs tests from your binary in parallel to provide significant speed-up.
+[GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter) is a VS Code extension allowing to view Google Tests in a tree view, and run/debug your tests.
+
## Requirements ##
Google Test is designed to have fairly minimal requirements to build
diff --git a/ci/env-linux.sh b/ci/env-linux.sh
index 9086b1f9..37800d6a 100755
--- a/ci/env-linux.sh
+++ b/ci/env-linux.sh
@@ -37,5 +37,5 @@
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
+ if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi
fi
diff --git a/ci/env-osx.sh b/ci/env-osx.sh
index 31c88357..127a969b 100755
--- a/ci/env-osx.sh
+++ b/ci/env-osx.sh
@@ -36,5 +36,5 @@
# TODO() - we can check if this is being sourced using $BASH_VERSION and $BASH_SOURCE[0] != ${0}.
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
+ if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi
fi
diff --git a/ci/install-linux.sh b/ci/install-linux.sh
index 02a19439..05e2cb28 100755
--- a/ci/install-linux.sh
+++ b/ci/install-linux.sh
@@ -41,7 +41,7 @@ if [ "${TRAVIS_SUDO}" = "true" ]; then
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | \
sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
- sudo apt-get update && sudo apt-get install -y bazel gcc-4.9 g++-4.9 clang-3.7
+ sudo apt-get update && sudo apt-get install -y bazel gcc-4.9 g++-4.9 clang-3.9
elif [ "${CXX}" = "clang++" ]; then
# Use ccache, assuming $HOME/bin is in the path, which is true in the Travis build environment.
ln -sf /usr/bin/ccache $HOME/bin/${CXX};
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index bac2e3bf..8a8de1f6 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -5,10 +5,6 @@
# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
-# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
-# make it prominent in the GUI.
-option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
# A directory to find Google Test sources.
@@ -41,7 +37,7 @@ if (CMAKE_VERSION VERSION_LESS 3.0)
project(gmock CXX C)
else()
cmake_policy(SET CMP0048 NEW)
- project(gmock VERSION 1.9.0 LANGUAGES CXX C)
+ project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
endif()
cmake_minimum_required(VERSION 2.6.4)
@@ -55,18 +51,29 @@ endif()
# if they are the same (the default).
add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")
+
+# These commands only run if this is the main project
+if(CMAKE_PROJECT_NAME STREQUAL "gmock" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
+ # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+ # make it prominent in the GUI.
+ option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+else()
+ mark_as_advanced(gmock_build_tests)
+endif()
+
# Although Google Test's CMakeLists.txt calls this function, the
# changes there don't affect the current scope. Therefore we have to
# call it again here.
config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
# Adds Google Mock's and Google Test's header directories to the search path.
-include_directories("${gmock_SOURCE_DIR}/include"
- "${gmock_SOURCE_DIR}"
- "${gtest_SOURCE_DIR}/include"
- # This directory is needed to build directly from Google
- # Test sources.
- "${gtest_SOURCE_DIR}")
+set(gmock_build_include_dirs
+ "${gmock_SOURCE_DIR}/include"
+ "${gmock_SOURCE_DIR}"
+ "${gtest_SOURCE_DIR}/include"
+ # This directory is needed to build directly from Google Test sources.
+ "${gtest_SOURCE_DIR}")
+include_directories(${gmock_build_include_dirs})
# Summary of tuple support for Microsoft Visual Studio:
# Compiler version(MS) version(cmake) Support
@@ -101,42 +108,26 @@ if (MSVC)
src/gmock_main.cc)
else()
cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
- target_link_libraries(gmock gtest)
+ target_link_libraries(gmock PUBLIC gtest)
cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc)
- target_link_libraries(gmock_main gmock)
+ target_link_libraries(gmock_main PUBLIC gmock)
endif()
-
# 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")
- target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
- target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
+ target_include_directories(gmock SYSTEM INTERFACE
+ "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
+ target_include_directories(gmock_main SYSTEM INTERFACE
+ "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
endif()
########################################################################
#
# Install rules
-if(INSTALL_GMOCK)
- install(TARGETS gmock gmock_main
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
- install(DIRECTORY "${gmock_SOURCE_DIR}/include/gmock"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
-
- # configure and install pkgconfig files
- configure_file(
- cmake/gmock.pc.in
- "${CMAKE_BINARY_DIR}/gmock.pc"
- @ONLY)
- configure_file(
- cmake/gmock_main.pc.in
- "${CMAKE_BINARY_DIR}/gmock_main.pc"
- @ONLY)
- install(FILES "${CMAKE_BINARY_DIR}/gmock.pc" "${CMAKE_BINARY_DIR}/gmock_main.pc"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-endif()
+install_project(gmock gmock_main)
########################################################################
#
@@ -203,13 +194,13 @@ if (gmock_build_tests)
endif()
else()
cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_exception gmock)
+ target_link_libraries(gmock_main_no_exception PUBLIC gmock)
cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_rtti gmock)
+ target_link_libraries(gmock_main_no_rtti PUBLIC gmock)
cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}" src/gmock_main.cc)
- target_link_libraries(gmock_main_use_own_tuple gmock)
+ target_link_libraries(gmock_main_use_own_tuple PUBLIC gmock)
endif()
cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
gmock_main_no_exception test/gmock-more-actions_test.cc)
diff --git a/googlemock/README.md b/googlemock/README.md
index ad374dea..be4758ae 100644
--- a/googlemock/README.md
+++ b/googlemock/README.md
@@ -144,27 +144,6 @@ to
target_link_libraries(example gmock_main)
This works because `gmock_main` library is compiled with Google Test.
-However, it does not automatically add Google Test includes.
-Therefore you will also have to change
-
- if (CMAKE_VERSION VERSION_LESS 2.8.11)
- include_directories("${gtest_SOURCE_DIR}/include")
- endif()
-
-to
-
- if (CMAKE_VERSION VERSION_LESS 2.8.11)
- include_directories(BEFORE SYSTEM
- "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
- else()
- target_include_directories(gmock_main SYSTEM BEFORE INTERFACE
- "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include")
- endif()
-
-This will addtionally mark Google Mock includes as system, which will
-silence compiler warnings when compiling your tests using clang with
-`-Wpedantic -Wall -Wextra -Wconversion`.
-
#### Preparing to Build (Unix only) ####
diff --git a/googlemock/docs/ForDummies.md b/googlemock/docs/ForDummies.md
index 1e0fd416..566a34e5 100644
--- a/googlemock/docs/ForDummies.md
+++ b/googlemock/docs/ForDummies.md
@@ -170,7 +170,7 @@ Admittedly, this test is contrived and doesn't do much. You can easily achieve t
## Using Google Mock with Any Testing Framework ##
If you want to use something other than Google Test (e.g. [CppUnit](http://sourceforge.net/projects/cppunit/) or
-[CxxTest](http://cxxtest.tigris.org/)) as your testing framework, just change the `main()` function in the previous section to:
+[CxxTest](https://cxxtest.com/)) as your testing framework, just change the `main()` function in the previous section to:
```
int main(int argc, char** argv) {
// The following line causes Google Mock to throw an exception on failure,
diff --git a/googlemock/docs/FrequentlyAskedQuestions.md b/googlemock/docs/FrequentlyAskedQuestions.md
index 23f7da03..9008c637 100644
--- a/googlemock/docs/FrequentlyAskedQuestions.md
+++ b/googlemock/docs/FrequentlyAskedQuestions.md
@@ -528,7 +528,7 @@ interface, which then can be easily mocked. It's a bit of work
initially, but usually pays for itself quickly.
This Google Testing Blog
-[post](http://googletesting.blogspot.com/2008/06/defeat-static-cling.html)
+[post](https://testing.googleblog.com/2008/06/defeat-static-cling.html)
says it excellently. Check it out.
## My mock object needs to do complex stuff. It's a lot of pain to specify the actions. Google Mock sucks! ##
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index a2784f63..b82313d5 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -26,13 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements some commonly used actions.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
diff --git a/googlemock/include/gmock/gmock-cardinalities.h b/googlemock/include/gmock/gmock-cardinalities.h
index fc315f92..f9169315 100644
--- a/googlemock/include/gmock/gmock-cardinalities.h
+++ b/googlemock/include/gmock/gmock-cardinalities.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -35,6 +34,8 @@
// cardinalities can be defined by the user implementing the
// CardinalityInterface interface if necessary.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
@@ -43,6 +44,9 @@
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
// To implement a cardinality Foo, define:
@@ -144,4 +148,6 @@ inline Cardinality MakeCardinality(const CardinalityInterface* c) {
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h
index 7728d745..260036da 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h
+++ b/googlemock/include/gmock/gmock-generated-actions.h
@@ -30,13 +30,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements some commonly used variadic actions.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
@@ -213,8 +214,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
get<2>(args), get<3>(args), get<4>(args), get<5>(args));
}
- // There is no InvokeCallback() for 6-tuples, as google3 callbacks
- // support 5 arguments at most.
+ // There is no InvokeCallback() for 6-tuples
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
@@ -238,8 +238,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
get<6>(args));
}
- // There is no InvokeCallback() for 7-tuples, as google3 callbacks
- // support 5 arguments at most.
+ // There is no InvokeCallback() for 7-tuples
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
@@ -264,8 +263,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
get<6>(args), get<7>(args));
}
- // There is no InvokeCallback() for 8-tuples, as google3 callbacks
- // support 5 arguments at most.
+ // There is no InvokeCallback() for 8-tuples
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
@@ -290,8 +288,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
get<6>(args), get<7>(args), get<8>(args));
}
- // There is no InvokeCallback() for 9-tuples, as google3 callbacks
- // support 5 arguments at most.
+ // There is no InvokeCallback() for 9-tuples
};
template <typename R, typename A1, typename A2, typename A3, typename A4,
@@ -318,8 +315,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
get<6>(args), get<7>(args), get<8>(args), get<9>(args));
}
- // There is no InvokeCallback() for 10-tuples, as google3 callbacks
- // support 5 arguments at most.
+ // There is no InvokeCallback() for 10-tuples
};
// Implements the Invoke(callback) action.
diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump
index 8bafa478..f1ee4a61 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h.pump
+++ b/googlemock/include/gmock/gmock-generated-actions.h.pump
@@ -32,13 +32,14 @@ $$}} This meta comment fixes auto-indentation in editors.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements some commonly used variadic actions.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
@@ -86,8 +87,7 @@ $if i <= max_callback_arity [[
return callback->Run($gets);
}
]] $else [[
- // There is no InvokeCallback() for $i-tuples, as google3 callbacks
- // support $max_callback_arity arguments at most.
+ // There is no InvokeCallback() for $i-tuples
]]
};
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h
index b8bf7a5a..5792d3d5 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h
@@ -30,13 +30,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements function mockers of various arities.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
index 6426d9a0..82f9512f 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -31,13 +31,14 @@ $var n = 10 $$ The maximum arity we support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements function mockers of various arities.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
@@ -139,7 +140,7 @@ const MockType* AdjustConstness_const(const MockType* mock) {
return mock;
}
-// Removes const from and returns the given pointer; this is a helper for the
+// Removes const from and returns the given pointer; this is a helper for the
// expectation setter method for parameterless matchers.
template <typename MockType>
MockType* AdjustConstness_(const MockType* mock) {
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h
index 21af61ba..41d53048 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h
+++ b/googlemock/include/gmock/gmock-generated-matchers.h
@@ -35,6 +35,8 @@
//
// This file implements some commonly used variadic matchers.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
@@ -1379,8 +1381,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
// ================
//
// To learn more about using these macros, please search for 'MATCHER'
-// on https://github.com/google/googletest/blob/master/googlemock/docs/
-// CookBook.md
+// on
+// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
#define MATCHER(name, description)\
class name##Matcher {\
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump
index 4b628444..1a59fede 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump
@@ -37,6 +37,8 @@ $$ }} This line fixes auto-indentation of the following code in Emacs.
//
// This file implements some commonly used variadic matchers.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
@@ -590,7 +592,8 @@ $$ // show up in the generated code.
// ================
//
// To learn more about using these macros, please search for 'MATCHER'
-// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
+// on
+// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
$range i 0..n
$for i
diff --git a/googlemock/include/gmock/gmock-generated-nice-strict.h b/googlemock/include/gmock/gmock-generated-nice-strict.h
index 8e568730..91ba1d9b 100644
--- a/googlemock/include/gmock/gmock-generated-nice-strict.h
+++ b/googlemock/include/gmock/gmock-generated-nice-strict.h
@@ -30,8 +30,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Implements class templates NiceMock, NaggyMock, and StrictMock.
//
@@ -63,6 +62,8 @@
// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
// supported.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/googlemock/include/gmock/gmock-generated-nice-strict.h.pump b/googlemock/include/gmock/gmock-generated-nice-strict.h.pump
index 2f443ae0..ed49f4ab 100644
--- a/googlemock/include/gmock/gmock-generated-nice-strict.h.pump
+++ b/googlemock/include/gmock/gmock-generated-nice-strict.h.pump
@@ -31,8 +31,7 @@ $var n = 10 $$ The maximum arity we support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Implements class templates NiceMock, NaggyMock, and StrictMock.
//
@@ -64,6 +63,8 @@ $var n = 10 $$ The maximum arity we support.
// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
// supported.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index eb096135..a7bcfc83 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -35,6 +34,8 @@
// matchers can be defined by the user implementing the
// MatcherInterface<T> interface if necessary.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
@@ -55,6 +56,11 @@
# include <initializer_list> // NOLINT -- must be after gtest.h
#endif
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(
+ 4251 5046 /* class A needs to have dll-interface to be used by clients of
+ class B */
+ /* Symbol involving type with internal linkage not defined */)
+
namespace testing {
// To implement a matcher Foo for type T, define:
@@ -72,7 +78,7 @@ namespace testing {
// MatchResultListener is an abstract class. Its << operator can be
// used by a matcher to explain why a value matches or doesn't match.
//
-// TODO(wan@google.com): add method
+// FIXME: add method
// bool InterestedInWhy(bool result) const;
// to indicate whether the listener is interested in why the match
// result is 'result'.
@@ -921,7 +927,7 @@ class TuplePrefix {
GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values);
StringMatchResultListener listener;
if (!matcher.MatchAndExplain(value, &listener)) {
- // TODO(wan): include in the message the name of the parameter
+ // FIXME: include in the message the name of the parameter
// as used in MOCK_METHOD*() when possible.
*os << " Expected arg #" << N - 1 << ": ";
get<N - 1>(matchers).DescribeTo(os);
@@ -2419,7 +2425,7 @@ class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
template <typename From>
bool MatchAndExplain(From from, MatchResultListener* listener) const {
- // TODO(sbenza): Add more detail on failures. ie did the dyn_cast fail?
+ // FIXME: Add more detail on failures. ie did the dyn_cast fail?
To to = dynamic_cast<To>(from);
return MatchPrintAndExplain(to, this->matcher_, listener);
}
@@ -2598,16 +2604,20 @@ class PropertyMatcher {
// Type traits specifying various features of different functors for ResultOf.
// The default template specifies features for functor objects.
-// Functor classes have to typedef argument_type and result_type
-// to be compatible with ResultOf.
template <typename Functor>
struct CallableTraits {
- typedef typename Functor::result_type ResultType;
typedef Functor StorageType;
static void CheckIsValid(Functor /* functor */) {}
+
+#if GTEST_LANG_CXX11
+ template <typename T>
+ static auto Invoke(Functor f, T arg) -> decltype(f(arg)) { return f(arg); }
+#else
+ typedef typename Functor::result_type ResultType;
template <typename T>
static ResultType Invoke(Functor f, T arg) { return f(arg); }
+#endif
};
// Specialization for function pointers.
@@ -2628,13 +2638,11 @@ struct CallableTraits<ResType(*)(ArgType)> {
// Implements the ResultOf() matcher for matching a return value of a
// unary function of an object.
-template <typename Callable>
+template <typename Callable, typename InnerMatcher>
class ResultOfMatcher {
public:
- typedef typename CallableTraits<Callable>::ResultType ResultType;
-
- ResultOfMatcher(Callable callable, const Matcher<ResultType>& matcher)
- : callable_(callable), matcher_(matcher) {
+ ResultOfMatcher(Callable callable, InnerMatcher matcher)
+ : callable_(internal::move(callable)), matcher_(internal::move(matcher)) {
CallableTraits<Callable>::CheckIsValid(callable_);
}
@@ -2648,9 +2656,17 @@ class ResultOfMatcher {
template <typename T>
class Impl : public MatcherInterface<T> {
+#if GTEST_LANG_CXX11
+ using ResultType = decltype(CallableTraits<Callable>::template Invoke<T>(
+ std::declval<CallableStorageType>(), std::declval<T>()));
+#else
+ typedef typename CallableTraits<Callable>::ResultType ResultType;
+#endif
+
public:
- Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)
- : callable_(callable), matcher_(matcher) {}
+ template <typename M>
+ Impl(const CallableStorageType& callable, const M& matcher)
+ : callable_(callable), matcher_(MatcherCast<ResultType>(matcher)) {}
virtual void DescribeTo(::std::ostream* os) const {
*os << "is mapped by the given callable to a value that ";
@@ -2664,8 +2680,10 @@ class ResultOfMatcher {
virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {
*listener << "which is mapped by the given callable to ";
- // Cannot pass the return value (for example, int) to
- // MatchPrintAndExplain, which takes a non-const reference as argument.
+ // Cannot pass the return value directly to MatchPrintAndExplain, which
+ // takes a non-const reference as argument.
+ // Also, specifying template argument explicitly is needed because T could
+ // be a non-const reference (e.g. Matcher<Uncopyable&>).
ResultType result =
CallableTraits<Callable>::template Invoke<T>(callable_, obj);
return MatchPrintAndExplain(result, matcher_, listener);
@@ -2675,7 +2693,7 @@ class ResultOfMatcher {
// Functors often define operator() as non-const method even though
// they are actually stateless. But we need to use them even when
// 'this' is a const pointer. It's the user's responsibility not to
- // use stateful callables with ResultOf(), which does't guarantee
+ // use stateful callables with ResultOf(), which doesn't guarantee
// how many times the callable will be invoked.
mutable CallableStorageType callable_;
const Matcher<ResultType> matcher_;
@@ -2684,7 +2702,7 @@ class ResultOfMatcher {
}; // class Impl
const CallableStorageType callable_;
- const Matcher<ResultType> matcher_;
+ const InnerMatcher matcher_;
GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);
};
@@ -4550,26 +4568,15 @@ Property(const std::string& property_name,
// For example,
// ResultOf(f, StartsWith("hi"))
// matches a Foo object x iff f(x) starts with "hi".
-// callable parameter can be a function, function pointer, or a functor.
-// Callable has to satisfy the following conditions:
-// * It is required to keep no state affecting the results of
-// the calls on it and make no assumptions about how many calls
-// will be made. Any state it keeps must be protected from the
-// concurrent access.
-// * If it is a function object, it has to define type result_type.
-// We recommend deriving your functor classes from std::unary_function.
-//
-template <typename Callable, typename ResultOfMatcher>
-internal::ResultOfMatcher<Callable> ResultOf(
- Callable callable, const ResultOfMatcher& matcher) {
- return internal::ResultOfMatcher<Callable>(
- callable,
- MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
- matcher));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // ResultOf(Function, m)
- // to compile where Function() returns an int32 and m is a matcher for int64.
+// `callable` parameter can be a function, function pointer, or a functor. It is
+// required to keep no state affecting the results of the calls on it and make
+// no assumptions about how many calls will be made. Any state it keeps must be
+// protected from the concurrent access.
+template <typename Callable, typename InnerMatcher>
+internal::ResultOfMatcher<Callable, InnerMatcher> ResultOf(
+ Callable callable, InnerMatcher matcher) {
+ return internal::ResultOfMatcher<Callable, InnerMatcher>(
+ internal::move(callable), internal::move(matcher));
}
// String matchers.
@@ -5265,6 +5272,8 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > VariantWith(
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046
+
// Include any custom callback matchers added by the local installation.
// We must include this header at the end to make sure it can use the
// declarations from this file.
diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h
index 3d387b6b..4d9a28ea 100644
--- a/googlemock/include/gmock/gmock-more-actions.h
+++ b/googlemock/include/gmock/gmock-more-actions.h
@@ -26,13 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file implements some actions that depend on gmock-generated-actions.h.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
diff --git a/googlemock/include/gmock/gmock-more-matchers.h b/googlemock/include/gmock/gmock-more-matchers.h
index 6d810eb7..1c9a399a 100644
--- a/googlemock/include/gmock/gmock-more-matchers.h
+++ b/googlemock/include/gmock/gmock-more-matchers.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: marcus.boerger@google.com (Marcus Boerger)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -36,8 +35,10 @@
// Note that tests are implemented in gmock-matchers_test.cc rather than
// gmock-more-matchers-test.cc.
-#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
-#define GMOCK_GMOCK_MORE_MATCHERS_H_
+// GOOGLETEST_CM0002 DO NOT DELETE
+
+#ifndef GMOCK_INCLUDE_GMOCK_MORE_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_MORE_MATCHERS_H_
#include "gmock/gmock-generated-matchers.h"
@@ -88,4 +89,4 @@ MATCHER(IsFalse, negation ? "is true" : "is false") {
} // namespace testing
-#endif // GMOCK_GMOCK_MORE_MATCHERS_H_
+#endif // GMOCK_INCLUDE_GMOCK_MORE_MATCHERS_H_
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index 090cff48..436e2d8b 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -57,6 +56,8 @@
// where all clauses are optional, and .InSequence()/.After()/
// .WillOnce() can appear any number of times.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
@@ -76,6 +77,9 @@
# include <stdexcept> // NOLINT
#endif
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
// An abstract handle of an expectation.
@@ -183,7 +187,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
// this information in the global mock registry. Will be called
// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
// method.
- // TODO(wan@google.com): rename to SetAndRegisterOwner().
+ // FIXME: rename to SetAndRegisterOwner().
void RegisterOwner(const void* mock_obj)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
@@ -1206,7 +1210,7 @@ class TypedExpectation : public ExpectationBase {
mocker->DescribeDefaultActionTo(args, what);
DescribeCallCountTo(why);
- // TODO(wan@google.com): allow the user to control whether
+ // FIXME: allow the user to control whether
// unexpected calls should fail immediately or continue using a
// flag --gmock_unexpected_calls_are_fatal.
return NULL;
@@ -1356,11 +1360,7 @@ class ReferenceOrValueWrapper<T&> {
// we need to temporarily disable the warning. We have to do it for
// the entire class to suppress the warning, even though it's about
// the constructor only.
-
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4355) // Temporarily disables warning 4355.
-#endif // _MSV_VER
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355)
// C++ treats the void type specially. For example, you cannot define
// a void-typed variable or pass a void value to a function.
@@ -1796,9 +1796,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);
}; // class FunctionMockerBase
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSV_VER
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4355
// Implements methods of FunctionMockerBase.
@@ -1843,6 +1841,8 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
// Implementation for ON_CALL and EXPECT_CALL macros. A separate macro is
// required to avoid compile errors when the name of the method used in call is
// a result of macro expansion. See CompilesWithMethodNameExpandedFromMacro
diff --git a/googlemock/include/gmock/gmock.h b/googlemock/include/gmock/gmock.h
index 6ccb118b..dd962260 100644
--- a/googlemock/include/gmock/gmock.h
+++ b/googlemock/include/gmock/gmock.h
@@ -26,13 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This is the main header file a user should include.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_H_
diff --git a/googlemock/include/gmock/internal/custom/README.md b/googlemock/include/gmock/internal/custom/README.md
new file mode 100644
index 00000000..f6c93f61
--- /dev/null
+++ b/googlemock/include/gmock/internal/custom/README.md
@@ -0,0 +1,16 @@
+# Customization Points
+
+The custom directory is an injection point for custom user configurations.
+
+## Header `gmock-port.h`
+
+The following macros can be defined:
+
+### Flag related macros:
+
+* `GMOCK_DECLARE_bool_(name)`
+* `GMOCK_DECLARE_int32_(name)`
+* `GMOCK_DECLARE_string_(name)`
+* `GMOCK_DEFINE_bool_(name, default_val, doc)`
+* `GMOCK_DEFINE_int32_(name, default_val, doc)`
+* `GMOCK_DEFINE_string_(name, default_val, doc)`
diff --git a/googlemock/include/gmock/internal/custom/gmock-generated-actions.h b/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
index 7dc3b1ad..92d910cf 100644
--- a/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
+++ b/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
@@ -2,6 +2,8 @@
// pump.py gmock-generated-actions.h.pump
// DO NOT EDIT BY HAND!!!
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump b/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump
index 03cfd8c5..67c221f1 100644
--- a/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump
+++ b/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump
@@ -4,6 +4,8 @@ $$ it to callback-actions.h.
$$
$var max_callback_arity = 5
$$}} This meta comment fixes auto-indentation in editors.
+
+// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/googlemock/include/gmock/internal/custom/gmock-matchers.h b/googlemock/include/gmock/internal/custom/gmock-matchers.h
index af8240e6..14aafaab 100644
--- a/googlemock/include/gmock/internal/custom/gmock-matchers.h
+++ b/googlemock/include/gmock/internal/custom/gmock-matchers.h
@@ -27,11 +27,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// ============================================================
-// An installation-specific extension point for gmock-matchers.h.
-// ============================================================
+// Injection point for custom user configurations. See README for details
//
-// Adds google3 callback support to CallableTraits.
+// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
diff --git a/googlemock/include/gmock/internal/custom/gmock-port.h b/googlemock/include/gmock/internal/custom/gmock-port.h
index 9ce8bfe0..0030fe91 100644
--- a/googlemock/include/gmock/internal/custom/gmock-port.h
+++ b/googlemock/include/gmock/internal/custom/gmock-port.h
@@ -27,19 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Injection point for custom user configurations.
-// The following macros can be defined:
-//
-// Flag related macros:
-// GMOCK_DECLARE_bool_(name)
-// GMOCK_DECLARE_int32_(name)
-// GMOCK_DECLARE_string_(name)
-// GMOCK_DEFINE_bool_(name, default_val, doc)
-// GMOCK_DEFINE_int32_(name, default_val, doc)
-// GMOCK_DEFINE_string_(name, default_val, doc)
+// Injection point for custom user configurations. See README for details
//
// ** Custom implementation starts here **
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
index cd94d644..eaa56be9 100644
--- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
@@ -30,14 +30,15 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file contains template meta-programming utility classes needed
// for implementing Google Mock.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
index 800af17c..c1032798 100644
--- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
+++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
@@ -31,14 +31,15 @@ $var n = 10 $$ The maximum arity we support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
// This file contains template meta-programming utility classes needed
// for implementing Google Mock.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h
index c5841aba..db64c65c 100644
--- a/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -35,6 +34,8 @@
// Mock. They are subject to change without notice, so please DO NOT
// USE THEM IN USER CODE.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
@@ -359,7 +360,7 @@ class WithoutMatchers {
// Internal use only: access the singleton instance of WithoutMatchers.
GTEST_API_ WithoutMatchers GetWithoutMatchers();
-// TODO(wan@google.com): group all type utilities together.
+// FIXME: group all type utilities together.
// Type traits.
diff --git a/googlemock/include/gmock/internal/gmock-port.h b/googlemock/include/gmock/internal/gmock-port.h
index cb37f260..fda27dba 100644
--- a/googlemock/include/gmock/internal/gmock-port.h
+++ b/googlemock/include/gmock/internal/gmock-port.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vadimb@google.com (Vadim Berman)
+
//
// Low-level types and utilities for porting Google Mock to various
// platforms. All macros ending with _ and symbols defined in an
@@ -36,6 +35,8 @@
// end with _ are part of Google Mock's public API and can be used by
// code outside Google Mock.
+// GOOGLETEST_CM0002 DO NOT DELETE
+
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
diff --git a/googlemock/scripts/generator/cpp/ast.py b/googlemock/scripts/generator/cpp/ast.py
index cce32724..f14728b4 100755
--- a/googlemock/scripts/generator/cpp/ast.py
+++ b/googlemock/scripts/generator/cpp/ast.py
@@ -1264,6 +1264,9 @@ class AstBuilder(object):
return self._GetNestedType(Union)
def handle_enum(self):
+ token = self._GetNextToken()
+ if not (token.token_type == tokenize.NAME and token.name == 'class'):
+ self._AddBackToken(token)
return self._GetNestedType(Enum)
def handle_auto(self):
diff --git a/googlemock/scripts/generator/cpp/gmock_class_test.py b/googlemock/scripts/generator/cpp/gmock_class_test.py
index 018f90a6..c53e6000 100755
--- a/googlemock/scripts/generator/cpp/gmock_class_test.py
+++ b/googlemock/scripts/generator/cpp/gmock_class_test.py
@@ -444,5 +444,23 @@ void(const FooType& test_arg));
self.assertEqualIgnoreLeadingWhitespace(
expected, self.GenerateMocks(source))
+ def testEnumClass(self):
+ source = """
+class Test {
+ public:
+ enum class Baz { BAZINGA };
+ virtual void Bar(const FooType& test_arg);
+};
+"""
+ expected = """\
+class MockTest : public Test {
+public:
+MOCK_METHOD1(Bar,
+void(const FooType& test_arg));
+};
+"""
+ self.assertEqualIgnoreLeadingWhitespace(
+ expected, self.GenerateMocks(source))
+
if __name__ == '__main__':
unittest.main()
diff --git a/googlemock/scripts/upload.py b/googlemock/scripts/upload.py
index 6e6f9a14..95239dc2 100755
--- a/googlemock/scripts/upload.py
+++ b/googlemock/scripts/upload.py
@@ -242,7 +242,7 @@ class AbstractRpcServer(object):
The authentication process works as follows:
1) We get a username and password from the user
2) We use ClientLogin to obtain an AUTH token for the user
- (see http://code.google.com/apis/accounts/AuthForInstalledApps.html).
+ (see https://developers.google.com/identity/protocols/AuthForInstalledApps).
3) We pass the auth token to /_ah/login on the server to obtain an
authentication cookie. If login was successful, it tries to redirect
us to the URL we provided.
@@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
(content_type, body) ready for httplib.HTTP instance.
Source:
- http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
+ https://web.archive.org/web/20160116052001/code.activestate.com/recipes/146306
"""
BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
CRLF = '\r\n'
@@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
# svn cat translates keywords but svn diff doesn't. As a result of this
# behavior patching.PatchChunks() fails with a chunk mismatch error.
# This part was originally written by the Review Board development team
- # who had the same problem (http://reviews.review-board.org/r/276/).
+ # who had the same problem (https://reviews.reviewboard.org/r/276/).
# Mapping of keywords to known aliases
svn_keywords = {
# Standard keywords
@@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
status_lines = status.splitlines()
# If file is in a cl, the output will begin with
# "\n--- Changelist 'cl_name':\n". See
- # http://svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
+ # https://web.archive.org/web/20090918234815/svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
if (len(status_lines) == 3 and
not status_lines[0] and
status_lines[1].startswith("--- Changelist")):
diff --git a/googlemock/src/gmock-all.cc b/googlemock/src/gmock-all.cc
index 7aebce7a..e43c9b7b 100644
--- a/googlemock/src/gmock-all.cc
+++ b/googlemock/src/gmock-all.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Google C++ Mocking Framework (Google Mock)
//
diff --git a/googlemock/src/gmock-cardinalities.cc b/googlemock/src/gmock-cardinalities.cc
index 335b966e..0549f727 100644
--- a/googlemock/src/gmock-cardinalities.cc
+++ b/googlemock/src/gmock-cardinalities.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc
index 77caf2bc..e3a67485 100644
--- a/googlemock/src/gmock-internal-utils.cc
+++ b/googlemock/src/gmock-internal-utils.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc
index 194d992d..f8ddff15 100644
--- a/googlemock/src/gmock-matchers.cc
+++ b/googlemock/src/gmock-matchers.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc
index 22d002fe..b93f4e0e 100644
--- a/googlemock/src/gmock-spec-builders.cc
+++ b/googlemock/src/gmock-spec-builders.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -607,7 +606,7 @@ class MockObjectRegistry {
if (it->second.leakable) // The user said it's fine to leak this object.
continue;
- // TODO(wan@google.com): Print the type of the leaked object.
+ // FIXME: Print the type of the leaked object.
// This can help the user identify the leaked object.
std::cout << "\n";
const MockObjectState& state = it->second;
@@ -783,7 +782,7 @@ void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
const TestInfo* const test_info =
UnitTest::GetInstance()->current_test_info();
if (test_info != NULL) {
- // TODO(wan@google.com): record the test case name when the
+ // FIXME: record the test case name when the
// ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
// TearDownTestCase().
state.first_used_test_case = test_info->test_case_name();
diff --git a/googlemock/src/gmock.cc b/googlemock/src/gmock.cc
index 2308168b..36356c93 100644
--- a/googlemock/src/gmock.cc
+++ b/googlemock/src/gmock.cc
@@ -26,15 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
namespace testing {
-// TODO(wan@google.com): support using environment variables to
+// FIXME: support using environment variables to
// control the flag values, like what Google Test does.
GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
diff --git a/googlemock/src/gmock_main.cc b/googlemock/src/gmock_main.cc
index bd5be03b..a3a271e6 100644
--- a/googlemock/src/gmock_main.cc
+++ b/googlemock/src/gmock_main.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include <iostream>
#include "gmock/gmock.h"
@@ -37,7 +36,8 @@
// causes a link error when _tmain is defined in a static library and UNICODE
// is enabled. For this reason instead of _tmain, main function is used on
// Windows. See the following link to track the current status of this bug:
-// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
+// https://web.archive.org/web/20170912203238/connect.microsoft.com/VisualStudio/feedback/details/394464/wmain-link-error-in-the-static-library
+// // NOLINT
#if GTEST_OS_WINDOWS_MOBILE
# include <tchar.h> // NOLINT
diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc
index e8bdbee7..06e29a1e 100644
--- a/googlemock/test/gmock-actions_test.cc
+++ b/googlemock/test/gmock-actions_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -1344,7 +1343,7 @@ TEST(FunctorActionTest, UnusedArguments) {
}
// Test that basic built-in actions work with move-only arguments.
-// TODO(rburny): Currently, almost all ActionInterface-based actions will not
+// FIXME: Currently, almost all ActionInterface-based actions will not
// work, even if they only try to use other, copyable arguments. Implement them
// if necessary (but note that DoAll cannot work on non-copyable types anyway -
// so maybe it's better to make users use lambdas instead.
diff --git a/googlemock/test/gmock-cardinalities_test.cc b/googlemock/test/gmock-cardinalities_test.cc
index 04c792b5..132591bc 100644
--- a/googlemock/test/gmock-cardinalities_test.cc
+++ b/googlemock/test/gmock-cardinalities_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-generated-actions_test.cc b/googlemock/test/gmock-generated-actions_test.cc
index 40bbe6d9..a4602806 100644
--- a/googlemock/test/gmock-generated-actions_test.cc
+++ b/googlemock/test/gmock-generated-actions_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-generated-function-mockers_test.cc b/googlemock/test/gmock-generated-function-mockers_test.cc
index 0ff37556..f16833b2 100644
--- a/googlemock/test/gmock-generated-function-mockers_test.cc
+++ b/googlemock/test/gmock-generated-function-mockers_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-generated-internal-utils_test.cc b/googlemock/test/gmock-generated-internal-utils_test.cc
index 2e5abe56..ae0280fc 100644
--- a/googlemock/test/gmock-generated-internal-utils_test.cc
+++ b/googlemock/test/gmock-generated-internal-utils_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc
index f8633df2..5f53077c 100644
--- a/googlemock/test/gmock-internal-utils_test.cc
+++ b/googlemock/test/gmock-internal-utils_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 9f1a5471..4697f0bf 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -4598,6 +4597,7 @@ struct PolymorphicFunctor {
typedef int result_type;
int operator()(int n) { return n; }
int operator()(const char* s) { return static_cast<int>(strlen(s)); }
+ std::string operator()(int *p) { return p ? "good ptr" : "null"; }
};
TEST(ResultOfTest, WorksForPolymorphicFunctors) {
@@ -4612,6 +4612,23 @@ TEST(ResultOfTest, WorksForPolymorphicFunctors) {
EXPECT_FALSE(matcher_string.Matches("shrt"));
}
+#if GTEST_LANG_CXX11
+TEST(ResultOfTest, WorksForPolymorphicFunctorsIgnoringResultType) {
+ Matcher<int*> matcher = ResultOf(PolymorphicFunctor(), "good ptr");
+
+ int n = 0;
+ EXPECT_TRUE(matcher.Matches(&n));
+ EXPECT_FALSE(matcher.Matches(nullptr));
+}
+
+TEST(ResultOfTest, WorksForLambdas) {
+ Matcher<int> matcher =
+ ResultOf([](int str_len) { return std::string(str_len, 'x'); }, "xxx");
+ EXPECT_TRUE(matcher.Matches(3));
+ EXPECT_FALSE(matcher.Matches(1));
+}
+#endif
+
const int* ReferencingFunction(const int& n) { return &n; }
struct ReferencingFunctor {
diff --git a/googlemock/test/gmock-more-actions_test.cc b/googlemock/test/gmock-more-actions_test.cc
index b13518aa..08a2df09 100644
--- a/googlemock/test/gmock-more-actions_test.cc
+++ b/googlemock/test/gmock-more-actions_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-nice-strict_test.cc b/googlemock/test/gmock-nice-strict_test.cc
index c4194946..dce66423 100644
--- a/googlemock/test/gmock-nice-strict_test.cc
+++ b/googlemock/test/gmock-nice-strict_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gmock/gmock-generated-nice-strict.h"
diff --git a/googlemock/test/gmock-port_test.cc b/googlemock/test/gmock-port_test.cc
index d6a8d444..a2c2be24 100644
--- a/googlemock/test/gmock-port_test.cc
+++ b/googlemock/test/gmock-port_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc
index 715aac8c..7056c43c 100644
--- a/googlemock/test/gmock-spec-builders_test.cc
+++ b/googlemock/test/gmock-spec-builders_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
@@ -1176,7 +1175,7 @@ TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
TEST(UndefinedReturnValueTest,
ReturnValueIsMandatoryWhenNotDefaultConstructible) {
MockA a;
- // TODO(wan@google.com): We should really verify the output message,
+ // FIXME: We should really verify the output message,
// but we cannot yet due to that EXPECT_DEATH only captures stderr
// while Google Mock logs to stdout.
#if GTEST_HAS_EXCEPTIONS
diff --git a/googlemock/test/gmock_all_test.cc b/googlemock/test/gmock_all_test.cc
index 56d6c49c..e1774fbb 100644
--- a/googlemock/test/gmock_all_test.cc
+++ b/googlemock/test/gmock_all_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for Google C++ Mocking Framework (Google Mock)
//
diff --git a/googlemock/test/gmock_ex_test.cc b/googlemock/test/gmock_ex_test.cc
index b03de82e..72eb43f7 100644
--- a/googlemock/test/gmock_ex_test.cc
+++ b/googlemock/test/gmock_ex_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Mock's functionality that depends on exceptions.
diff --git a/googlemock/test/gmock_leak_test.py b/googlemock/test/gmock_leak_test.py
index 997680ce..7e4b1eea 100755
--- a/googlemock/test/gmock_leak_test.py
+++ b/googlemock/test/gmock_leak_test.py
@@ -31,12 +31,8 @@
"""Tests that leaked mock objects can be caught be Google Mock."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
-
import gmock_test_utils
-
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']
TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*']
diff --git a/googlemock/test/gmock_leak_test_.cc b/googlemock/test/gmock_leak_test_.cc
index 1d27d22f..2e095abc 100644
--- a/googlemock/test/gmock_leak_test_.cc
+++ b/googlemock/test/gmock_leak_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock_link2_test.cc b/googlemock/test/gmock_link2_test.cc
index 2b48395c..d27ce176 100644
--- a/googlemock/test/gmock_link2_test.cc
+++ b/googlemock/test/gmock_link2_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock_link_test.cc b/googlemock/test/gmock_link_test.cc
index ef041be9..e7c54cc2 100644
--- a/googlemock/test/gmock_link_test.cc
+++ b/googlemock/test/gmock_link_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock_link_test.h b/googlemock/test/gmock_link_test.h
index 06a1cf89..d26670ec 100644
--- a/googlemock/test/gmock_link_test.h
+++ b/googlemock/test/gmock_link_test.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock_output_test.py b/googlemock/test/gmock_output_test.py
index 9d73d570..0527bd93 100755
--- a/googlemock/test/gmock_output_test.py
+++ b/googlemock/test/gmock_output_test.py
@@ -29,21 +29,19 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests the text output of Google C++ Mocking Framework.
+r"""Tests the text output of Google C++ Mocking Framework.
To update the golden file:
gmock_output_test.py --build_dir=BUILD/DIR --gengolden
-# where BUILD/DIR contains the built gmock_output_test_ file.
+where BUILD/DIR contains the built gmock_output_test_ file.
gmock_output_test.py --gengolden
gmock_output_test.py
-"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
+"""
import os
import re
import sys
-
import gmock_test_utils
diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc
index 1b59eb3f..3955c733 100644
--- a/googlemock/test/gmock_output_test_.cc
+++ b/googlemock/test/gmock_output_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Mock's output in various scenarios. This ensures that
// Google Mock's messages are readable and useful.
diff --git a/googlemock/test/gmock_stress_test.cc b/googlemock/test/gmock_stress_test.cc
index b9fdc45c..0d99bede 100644
--- a/googlemock/test/gmock_stress_test.cc
+++ b/googlemock/test/gmock_stress_test.cc
@@ -26,20 +26,18 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests that Google Mock constructs can be used in a large number of
// threads concurrently.
#include "gmock/gmock.h"
-
#include "gtest/gtest.h"
namespace testing {
namespace {
-// From "gtest/internal/gtest-port.h".
+// From gtest-port.h.
using ::testing::internal::ThreadWithParam;
// The maximum number of test threads (not including helper threads)
diff --git a/googlemock/test/gmock_test.cc b/googlemock/test/gmock_test.cc
index 70075679..341a17da 100644
--- a/googlemock/test/gmock_test.cc
+++ b/googlemock/test/gmock_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Mock - a framework for writing C++ mock classes.
//
diff --git a/googlemock/test/gmock_test_utils.py b/googlemock/test/gmock_test_utils.py
index 92b1ac14..7dc4e119 100755
--- a/googlemock/test/gmock_test_utils.py
+++ b/googlemock/test/gmock_test_utils.py
@@ -29,8 +29,6 @@
"""Unit test utilities for Google C++ Mocking Framework."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import sys
diff --git a/googletest/Android.bp b/googletest/Android.bp
index 80cd67ce..5888860a 100644
--- a/googletest/Android.bp
+++ b/googletest/Android.bp
@@ -15,7 +15,7 @@
cc_defaults {
name: "libgtest_defaults",
export_include_dirs: ["include"],
- cflags: ["-Wall", "-Werror", "-Wno-missing-field-initializers"],
+ cflags: ["-Wall", "-Werror", "-Wno-unused-private-field"],
}
cc_defaults {
diff --git a/googletest/Android.mk b/googletest/Android.mk
index feb57ed8..14c7d46a 100644
--- a/googletest/Android.mk
+++ b/googletest/Android.mk
@@ -63,24 +63,26 @@ endef
# pthread_atfork on android-9.
define gtest-test-suite
$(eval $(call gtest-unit-test, \
- gtest-death-test_test,,libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-filepath_test,, \
+ googletest-death-test-test,,libgtest_main,$(1),$(2))) \
+ $(eval $(call gtest-unit-test,googletest-filepath-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-linked_ptr_test,, \
+ $(eval $(call gtest-unit-test,googletest-linked-ptr-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-listener_test,, \
+ $(eval $(call gtest-unit-test,googletest-listener-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-message_test,, \
+ $(eval $(call gtest-unit-test,googletest-message-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-options_test,, \
+ $(eval $(call gtest-unit-test,googletest-options-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-param-test_test, \
- test/gtest-param-test2_test.cc,,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-port_test,,libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-printers_test,,libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-test-part_test,, \
+ $(eval $(call gtest-unit-test,googletest-param-test-test, \
+ test/googletest-param-test2-test.cc,,$(1),$(2))) \
+ $(eval $(call gtest-unit-test,googletest-port-test,, \
libgtest_main,$(1),$(2))) \
- $(eval $(call gtest-unit-test,gtest-tuple_test,,libgtest_main,$(1),$(2))) \
+ $(eval $(call gtest-unit-test,googletest-printers-test,, \
+ libgtest_main,$(1),$(2))) \
+ $(eval $(call gtest-unit-test,googletest-test-part-test,, \
+ libgtest_main,$(1),$(2))) \
+ $(eval $(call gtest-unit-test,googletest-tuple-test,,libgtest_main,$(1),$(2))) \
$(eval $(call gtest-unit-test, \
gtest-typed-test_test,test/gtest-typed-test2_test.cc, \
libgtest_main,$(1),$(2))) \
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
index 2e412d7f..9ee79408 100644
--- a/googletest/CMakeLists.txt
+++ b/googletest/CMakeLists.txt
@@ -5,10 +5,6 @@
# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
-# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
-# make it prominent in the GUI.
-option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-
# When other libraries are using a shared version of runtime libraries,
# Google Test also has to use one.
option(
@@ -48,7 +44,7 @@ if (CMAKE_VERSION VERSION_LESS 3.0)
project(gtest CXX C)
else()
cmake_policy(SET CMP0048 NEW)
- project(gtest VERSION 1.9.0 LANGUAGES CXX C)
+ project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
endif()
cmake_minimum_required(VERSION 2.6.4)
@@ -60,6 +56,25 @@ if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()
+# These commands only run if this is the main project
+if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
+
+ # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+ # make it prominent in the GUI.
+ option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+else()
+
+ mark_as_advanced(
+ gtest_force_shared_crt
+ gtest_build_tests
+ gtest_build_samples
+ gtest_disable_pthreads
+ gtest_hide_internal_symbols)
+
+endif()
+
+
if (gtest_hide_internal_symbols)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
@@ -70,10 +85,30 @@ include(cmake/internal_utils.cmake)
config_compiler_and_linker() # Defined in internal_utils.cmake.
+# 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}")
+ set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake")
+ write_basic_package_version_file(${version_file} COMPATIBILITY AnyNewerVersion)
+ install(EXPORT ${targets_export_name}
+ NAMESPACE ${cmake_package_name}::
+ DESTINATION ${cmake_files_install_dir})
+ set(config_file "${generated_dir}/${cmake_package_name}Config.cmake")
+ configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in"
+ "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir})
+ install(FILES ${version_file} ${config_file}
+ DESTINATION ${cmake_files_install_dir})
+endif()
+
# Where Google Test's .h files can be found.
-include_directories(
+set(gtest_build_include_dirs
"${gtest_SOURCE_DIR}/include"
"${gtest_SOURCE_DIR}")
+include_directories(${gtest_build_include_dirs})
# Summary of tuple support for Microsoft Visual Studio:
# Compiler version(MS) version(cmake) Support
@@ -86,7 +121,7 @@ include_directories(
if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10)
endif()
-
+
########################################################################
#
# Defines the gtest & gtest_main libraries. User tests should link
@@ -97,39 +132,23 @@ endif()
# aggressive about warnings.
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
-target_link_libraries(gtest_main gtest)
-
# 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")
- target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
- target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
+ target_include_directories(gtest SYSTEM INTERFACE
+ "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
+ target_include_directories(gtest_main SYSTEM INTERFACE
+ "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
endif()
+target_link_libraries(gtest_main PUBLIC gtest)
########################################################################
#
# Install rules
-if(INSTALL_GTEST)
- install(TARGETS gtest gtest_main
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
- install(DIRECTORY "${gtest_SOURCE_DIR}/include/gtest"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
-
- # configure and install pkgconfig files
- configure_file(
- cmake/gtest.pc.in
- "${CMAKE_BINARY_DIR}/gtest.pc"
- @ONLY)
- configure_file(
- cmake/gtest_main.pc.in
- "${CMAKE_BINARY_DIR}/gtest_main.pc"
- @ONLY)
- install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-endif()
+install_project(gtest gtest_main)
########################################################################
#
@@ -171,28 +190,28 @@ if (gtest_build_tests)
############################################################
# C++ tests built with standard compiler flags.
- cxx_test(gtest-death-test_test gtest_main)
+ cxx_test(googletest-death-test-test gtest_main)
cxx_test(gtest_environment_test gtest)
- cxx_test(gtest-filepath_test gtest_main)
- cxx_test(gtest-linked_ptr_test gtest_main)
- cxx_test(gtest-listener_test gtest_main)
+ cxx_test(googletest-filepath-test gtest_main)
+ cxx_test(googletest-linked-ptr-test gtest_main)
+ cxx_test(googletest-listener-test gtest_main)
cxx_test(gtest_main_unittest gtest_main)
- cxx_test(gtest-message_test gtest_main)
+ cxx_test(googletest-message-test gtest_main)
cxx_test(gtest_no_test_unittest gtest)
- cxx_test(gtest-options_test gtest_main)
- cxx_test(gtest-param-test_test gtest
- test/gtest-param-test2_test.cc)
- cxx_test(gtest-port_test gtest_main)
+ cxx_test(googletest-options-test gtest_main)
+ cxx_test(googletest-param-test-test gtest
+ test/googletest-param-test2-test.cc)
+ cxx_test(googletest-port-test gtest_main)
cxx_test(gtest_pred_impl_unittest gtest_main)
cxx_test(gtest_premature_exit_test gtest
test/gtest_premature_exit_test.cc)
- cxx_test(gtest-printers_test gtest_main)
+ cxx_test(googletest-printers-test gtest_main)
cxx_test(gtest_prod_test gtest_main
test/production.cc)
cxx_test(gtest_repeat_test gtest)
cxx_test(gtest_sole_header_test gtest_main)
cxx_test(gtest_stress_test gtest)
- cxx_test(gtest-test-part_test gtest_main)
+ cxx_test(googletest-test-part-test gtest_main)
cxx_test(gtest_throw_on_failure_ex_test gtest)
cxx_test(gtest-typed-test_test gtest_main
test/gtest-typed-test2_test.cc)
@@ -214,10 +233,10 @@ if (gtest_build_tests)
cxx_test_with_flags(gtest-death-test_ex_nocatch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
- gtest test/gtest-death-test_ex_test.cc)
+ gtest test/googletest-death-test_ex_test.cc)
cxx_test_with_flags(gtest-death-test_ex_catch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
- gtest test/gtest-death-test_ex_test.cc)
+ gtest test/googletest-death-test_ex_test.cc)
cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
gtest_main_no_rtti test/gtest_unittest.cc)
@@ -238,75 +257,75 @@ if (gtest_build_tests)
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
src/gtest-all.cc src/gtest_main.cc)
- cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
- gtest_main_use_own_tuple test/gtest-tuple_test.cc)
+ cxx_test_with_flags(googletest-tuple-test "${cxx_use_own_tuple}"
+ gtest_main_use_own_tuple test/googletest-tuple-test.cc)
cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple
- test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
+ test/googletest-param-test-test.cc test/googletest-param-test2-test.cc)
endif()
############################################################
# Python tests.
- cxx_executable(gtest_break_on_failure_unittest_ test gtest)
- py_test(gtest_break_on_failure_unittest)
+ cxx_executable(googletest-break-on-failure-unittest_ test gtest)
+ py_test(googletest-break-on-failure-unittest)
# Visual Studio .NET 2003 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
cxx_executable_with_flags(
- gtest_catch_exceptions_no_ex_test_
+ googletest-catch-exceptions-no-ex-test_
"${cxx_no_exception}"
gtest_main_no_exception
- test/gtest_catch_exceptions_test_.cc)
+ test/googletest-catch-exceptions-test_.cc)
endif()
cxx_executable_with_flags(
- gtest_catch_exceptions_ex_test_
+ googletest-catch-exceptions-ex-test_
"${cxx_exception}"
gtest_main
- test/gtest_catch_exceptions_test_.cc)
- py_test(gtest_catch_exceptions_test)
+ test/googletest-catch-exceptions-test_.cc)
+ py_test(googletest-catch-exceptions-test)
- cxx_executable(gtest_color_test_ test gtest)
- py_test(gtest_color_test)
+ cxx_executable(googletest-color-test_ test gtest)
+ py_test(googletest-color-test)
- cxx_executable(gtest_env_var_test_ test gtest)
- py_test(gtest_env_var_test)
+ cxx_executable(googletest-env-var-test_ test gtest)
+ py_test(googletest-env-var-test)
- cxx_executable(gtest_filter_unittest_ test gtest)
- py_test(gtest_filter_unittest)
+ cxx_executable(googletest-filter-unittest_ test gtest)
+ py_test(googletest-filter-unittest)
cxx_executable(gtest_help_test_ test gtest_main)
py_test(gtest_help_test)
- cxx_executable(gtest_list_tests_unittest_ test gtest)
- py_test(gtest_list_tests_unittest)
+ cxx_executable(googletest-list-tests-unittest_ test gtest)
+ py_test(googletest-list-tests-unittest)
- cxx_executable(gtest_output_test_ test gtest)
- py_test(gtest_output_test --no_stacktrace_support)
+ cxx_executable(googletest-output-test_ test gtest)
+ py_test(googletest-output-test --no_stacktrace_support)
- cxx_executable(gtest_shuffle_test_ test gtest)
- py_test(gtest_shuffle_test)
+ cxx_executable(googletest-shuffle-test_ test gtest)
+ py_test(googletest-shuffle-test)
# MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
- set_target_properties(gtest_throw_on_failure_test_
+ cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception)
+ set_target_properties(googletest-throw-on-failure-test_
PROPERTIES
COMPILE_FLAGS "${cxx_no_exception}")
- py_test(gtest_throw_on_failure_test)
+ py_test(googletest-throw-on-failure-test)
endif()
- cxx_executable(gtest_uninitialized_test_ test gtest)
- py_test(gtest_uninitialized_test)
+ cxx_executable(googletest-uninitialized-test_ test gtest)
+ py_test(googletest-uninitialized-test)
cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
py_test(gtest_xml_outfiles_test)
- py_test(gtest_json_outfiles_test)
+ py_test(googletest-json-outfiles-test)
cxx_executable(gtest_xml_output_unittest_ test gtest)
py_test(gtest_xml_output_unittest --no_stacktrace_support)
- py_test(gtest_json_output_unittest)
+ py_test(googletest-json-output-unittest --no_stacktrace_support)
endif()
diff --git a/googletest/Makefile.am b/googletest/Makefile.am
index b6c7232d..b44c8416 100644
--- a/googletest/Makefile.am
+++ b/googletest/Makefile.am
@@ -53,40 +53,40 @@ EXTRA_DIST += \
test/gtest-listener_test.cc \
test/gtest-message_test.cc \
test/gtest-options_test.cc \
- test/gtest-param-test2_test.cc \
- test/gtest-param-test2_test.cc \
- test/gtest-param-test_test.cc \
- test/gtest-param-test_test.cc \
+ test/googletest-param-test2-test.cc \
+ test/googletest-param-test2-test.cc \
+ test/googletest-param-test-test.cc \
+ test/googletest-param-test-test.cc \
test/gtest-param-test_test.h \
test/gtest-port_test.cc \
test/gtest_premature_exit_test.cc \
test/gtest-printers_test.cc \
test/gtest-test-part_test.cc \
- test/gtest-tuple_test.cc \
+ test/googletest-tuple-test.cc \
test/gtest-typed-test2_test.cc \
test/gtest-typed-test_test.cc \
test/gtest-typed-test_test.h \
test/gtest-unittest-api_test.cc \
- test/gtest_break_on_failure_unittest_.cc \
- test/gtest_catch_exceptions_test_.cc \
- test/gtest_color_test_.cc \
- test/gtest_env_var_test_.cc \
+ test/googletest-break-on-failure-unittest_.cc \
+ test/googletest-catch-exceptions-test_.cc \
+ test/googletest-color-test_.cc \
+ test/googletest-env-var-test_.cc \
test/gtest_environment_test.cc \
- test/gtest_filter_unittest_.cc \
+ test/googletest-filter-unittest_.cc \
test/gtest_help_test_.cc \
- test/gtest_list_tests_unittest_.cc \
+ test/googletest-list-tests-unittest_.cc \
test/gtest_main_unittest.cc \
test/gtest_no_test_unittest.cc \
- test/gtest_output_test_.cc \
+ test/googletest-output-test_.cc \
test/gtest_pred_impl_unittest.cc \
test/gtest_prod_test.cc \
test/gtest_repeat_test.cc \
- test/gtest_shuffle_test_.cc \
+ test/googletest-shuffle-test_.cc \
test/gtest_sole_header_test.cc \
test/gtest_stress_test.cc \
test/gtest_throw_on_failure_ex_test.cc \
- test/gtest_throw_on_failure_test_.cc \
- test/gtest_uninitialized_test_.cc \
+ test/googletest-throw-on-failure-test_.cc \
+ test/googletest-uninitialized-test_.cc \
test/gtest_unittest.cc \
test/gtest_unittest.cc \
test/gtest_xml_outfile1_test_.cc \
@@ -97,19 +97,19 @@ EXTRA_DIST += \
# Python tests that we don't run.
EXTRA_DIST += \
- test/gtest_break_on_failure_unittest.py \
- test/gtest_catch_exceptions_test.py \
- test/gtest_color_test.py \
- test/gtest_env_var_test.py \
- test/gtest_filter_unittest.py \
+ test/googletest-break-on-failure-unittest.py \
+ test/googletest-catch-exceptions-test.py \
+ test/googletest-color-test.py \
+ test/googletest-env-var-test.py \
+ test/googletest-filter-unittest.py \
test/gtest_help_test.py \
- test/gtest_list_tests_unittest.py \
- test/gtest_output_test.py \
- test/gtest_output_test_golden_lin.txt \
- test/gtest_shuffle_test.py \
+ test/googletest-list-tests-unittest.py \
+ test/googletest-output-test.py \
+ test/googletest-output-test_golden_lin.txt \
+ test/googletest-shuffle-test.py \
test/gtest_test_utils.py \
- test/gtest_throw_on_failure_test.py \
- test/gtest_uninitialized_test.py \
+ test/googletest-throw-on-failure-test.py \
+ test/googletest-uninitialized-test.py \
test/gtest_xml_outfiles_test.py \
test/gtest_xml_output_unittest.py \
test/gtest_xml_test_utils.py
diff --git a/googletest/cmake/Config.cmake.in b/googletest/cmake/Config.cmake.in
new file mode 100644
index 00000000..12be4498
--- /dev/null
+++ b/googletest/cmake/Config.cmake.in
@@ -0,0 +1,9 @@
+@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
+if (@GTEST_HAS_PTHREAD@)
+ set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@)
+ find_dependency(Threads)
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
+check_required_components("@project_name@")
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index be7af38f..8c1f9ba9 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -20,7 +20,7 @@ macro(fix_default_compiler_settings_)
if (MSVC)
# For MSVC, CMake sets certain flags to defaults we want to override.
# This replacement code is taken from sample in the CMake Wiki at
- # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
+ # https://gitlab.kitware.com/cmake/community/wikis/FAQ#dynamic-replace.
foreach (flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
@@ -38,6 +38,11 @@ macro(fix_default_compiler_settings_)
# We prefer more strict warning checking for building Google Test.
# Replaces /W3 with /W4 in defaults.
string(REPLACE "/W3" "/W4" ${flag_var} "${${flag_var}}")
+
+ # Prevent D9025 warning for targets that have exception handling
+ # turned off (/EHs-c- flag). Where required, exceptions are explicitly
+ # re-enabled using the cxx_exception_flags variable.
+ string(REPLACE "/EHsc" "" ${flag_var} "${${flag_var}}")
endforeach()
endif()
endmacro()
@@ -138,7 +143,7 @@ macro(config_compiler_and_linker)
set(cxx_base_flags "${cxx_base_flags} ${GTEST_HAS_PTHREAD_MACRO}")
# For building gtest's own tests and samples.
- set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")
+ set(cxx_exception "${cxx_base_flags} ${cxx_exception_flags}")
set(cxx_no_exception
"${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
set(cxx_default "${cxx_exception}")
@@ -166,9 +171,18 @@ function(cxx_library_with_type name type cxx_flags)
set_target_properties(${name}
PROPERTIES
COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
+ if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+ target_compile_definitions(${name} INTERFACE
+ $<INSTALL_INTERFACE:GTEST_LINKED_AS_SHARED_LIBRARY=1>)
+ endif()
endif()
if (DEFINED GTEST_HAS_PTHREAD)
- target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
+ if ("${CMAKE_VERSION}" VERSION_LESS "3.1.0")
+ set(threads_spec ${CMAKE_THREAD_LIBS_INIT})
+ else()
+ set(threads_spec Threads::Threads)
+ endif()
+ target_link_libraries(${name} PUBLIC ${threads_spec})
endif()
endfunction()
@@ -230,7 +244,7 @@ find_package(PythonInterp)
# from the given source files with the given compiler flags.
function(cxx_test_with_flags name cxx_flags libs)
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
- add_test(${name} ${name})
+ add_test(NAME ${name} COMMAND ${name})
endfunction()
# cxx_test(name libs srcs...)
@@ -278,3 +292,27 @@ function(py_test name)
endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
endif(PYTHONINTERP_FOUND)
endfunction()
+
+# install_project(targets...)
+#
+# Installs the specified targets and configures the associated pkgconfig files.
+function(install_project)
+ if(INSTALL_GTEST)
+ install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+ # Install the project targets.
+ install(TARGETS ${ARGN}
+ EXPORT ${targets_export_name}
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ # Configure and install pkgconfig files.
+ foreach(t ${ARGN})
+ set(configured_pc "${generated_dir}/${t}.pc")
+ configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in"
+ "${configured_pc}" @ONLY)
+ install(FILES "${configured_pc}"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ endforeach()
+ endif()
+endfunction()
diff --git a/googletest/docs/XcodeGuide.md b/googletest/docs/XcodeGuide.md
index 117265c5..1c60a33d 100644
--- a/googletest/docs/XcodeGuide.md
+++ b/googletest/docs/XcodeGuide.md
@@ -6,7 +6,7 @@ This guide will explain how to use the Google Testing Framework in your Xcode pr
Here is the quick guide for using Google Test in your Xcode project.
- 1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`.
+ 1. Download the source from the [website](https://github.com/google/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`.
1. Open up the `gtest.xcodeproj` in the `googletest-read-only/xcode/` directory and build the gtest.framework.
1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests".
1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests".
@@ -18,7 +18,7 @@ The following sections further explain each of the steps listed above in depth,
# Get the Source #
-Currently, the gtest.framework discussed here isn't available in a tagged release of Google Test, it is only available in the trunk. As explained at the Google Test [site](http://code.google.com/p/googletest/source/checkout">svn), you can get the code from anonymous SVN with this command:
+Currently, the gtest.framework discussed here isn't available in a tagged release of Google Test, it is only available in the trunk. As explained at the Google Test [site](https://github.com/google/googletest), you can get the code from anonymous SVN with this command:
```
svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
@@ -28,7 +28,7 @@ Alternatively, if you are working with Subversion in your own code base, you can
To use `svn:externals`, decide where you would like to have the external source reside. You might choose to put the external source inside the trunk, because you want it to be part of the branch when you make a release. However, keeping it outside the trunk in a version-tagged directory called something like `third-party/googletest/1.0.1`, is another option. Once the location is established, use `svn propedit svn:externals _directory_` to set the svn:externals property on a directory in your repository. This directory won't contain the code, but be its versioned parent directory.
-The command `svn propedit` will bring up your Subversion editor, making editing the long, (potentially multi-line) property simpler. This same method can be used to check out a tagged branch, by using the appropriate URL (e.g. `http://googletest.googlecode.com/svn/tags/release-1.0.1`). Additionally, the svn:externals property allows the specification of a particular revision of the trunk with the `-r_##_` option (e.g. `externals/src/googletest -r60 http://googletest.googlecode.com/svn/trunk`).
+The command `svn propedit` will bring up your Subversion editor, making editing the long, (potentially multi-line) property simpler. This same method can be used to check out a tagged branch, by using the appropriate URL (e.g. `https://github.com/google/googletest/releases/tag/release-1.0.1`). Additionally, the svn:externals property allows the specification of a particular revision of the trunk with the `-r_##_` option (e.g. `externals/src/googletest -r60 http://googletest.googlecode.com/svn/trunk`).
Here is an example of using the svn:externals properties on a trunk (read via `svn propget`) of a project. This value checks out a copy of Google Test into the `trunk/externals/src/googletest/` directory.
@@ -90,4 +90,4 @@ The Debugger has exited with status 0.
# Summary #
-Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment. \ No newline at end of file
+Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment.
diff --git a/googletest/docs/advanced.md b/googletest/docs/advanced.md
index 6883784d..8065d196 100644
--- a/googletest/docs/advanced.md
+++ b/googletest/docs/advanced.md
@@ -3,7 +3,7 @@
## Introduction
-Now that you have read the [googletest Primer](primer) and learned how to write
+Now that you have read the [googletest Primer](primer.md) and learned how to write
tests using googletest, it's time to learn some new tricks. This document will
show you more assertions as well as how to construct complex failure messages,
propagate fatal failures, reuse and speed up your test fixtures, and use various
@@ -103,13 +103,11 @@ If you already have a function or functor that returns `bool` (or a type that
can be implicitly converted to `bool`), you can use it in a *predicate
assertion* to get the function arguments printed for free:
-| Fatal assertion | Nonfatal assertion | Verifies |
-| -------------------- | -------------------- | --------------------------- |
-| `ASSERT_PRED1(pred1, | `EXPECT_PRED1(pred1, | `pred1(val1)` is true |
-: val1);` : val1);` : :
-| `ASSERT_PRED2(pred2, | `EXPECT_PRED2(pred2, | `pred2(val1, val2)` is true |
-: val1, val2);` : val1, val2);` : :
-| `...` | `...` | ... |
+| Fatal assertion | Nonfatal assertion | Verifies |
+| ---------------------------------- | ---------------------------------- | --------------------------- |
+| `ASSERT_PRED1(pred1, val1);` | `EXPECT_PRED1(pred1, val1);` | `pred1(val1)` is true |
+| `ASSERT_PRED2(pred2, val1, val2);` | `EXPECT_PRED2(pred2, val1, val2);` | `pred2(val1, val2)` is true |
+| `...` | `...` | ... |
In the above, `predn` is an `n`-ary predicate function or functor, where `val1`,
`val2`, ..., and `valn` are its arguments. The assertion succeeds if the
@@ -120,7 +118,7 @@ either case, the arguments are evaluated exactly once.
Here's an example. Given
```c++
-// Returns true iff m and n have no common divisors except 1.
+// Returns true if m and n have no common divisors except 1.
bool MutuallyPrime(int m, int n) { ... }
const int a = 3;
@@ -152,9 +150,9 @@ c is 10
>
> 1. If you see a compiler error "no matching function to call" when using
> `ASSERT_PRED*` or `EXPECT_PRED*`, please see
-> [this](faq#OverloadedPredicate) for how to resolve it.
+> [this](faq.md#OverloadedPredicate) for how to resolve it.
> 1. Currently we only provide predicate assertions of arity <= 5. If you need
-> a higher-arity assertion, let [us](http://g/opensource-gtest) know.
+> a higher-arity assertion, let [us](https://github.com/google/googletest/issues) know.
**Availability**: Linux, Windows, Mac.
@@ -339,12 +337,10 @@ want to learn more, see
#### Floating-Point Macros
-| Fatal assertion | Nonfatal assertion | Verifies |
-| ----------------------- | ----------------------- | ----------------------- |
-| `ASSERT_FLOAT_EQ(val1, | `EXPECT_FLOAT_EQ(val1, | the two `float` values |
-: val2);` : val2);` : are almost equal :
-| `ASSERT_DOUBLE_EQ(val1, | `EXPECT_DOUBLE_EQ(val1, | the two `double` values |
-: val2);` : val2);` : are almost equal :
+| Fatal assertion | Nonfatal assertion | Verifies |
+| ------------------------------- | ------------------------------ | ---------------------------------------- |
+| `ASSERT_FLOAT_EQ(val1, val2);` | `EXPECT_FLOAT_EQ(val1,val2);` | the two `float` values are almost equal |
+| `ASSERT_DOUBLE_EQ(val1, val2);` | `EXPECT_DOUBLE_EQ(val1, val2);`| the two `double` values are almost equal |
By "almost equal" we mean the values are within 4 ULP's from each other.
@@ -354,12 +350,9 @@ unsafe and has been deprecated. Please don't use it any more.
The following assertions allow you to choose the acceptable error bound:
-| Fatal assertion | Nonfatal assertion | Verifies |
-| ------------------ | ------------------------ | ------------------------- |
-| `ASSERT_NEAR(val1, | `EXPECT_NEAR(val1, val2, | the difference between |
-: val2, abs_error);` : abs_error);` : `val1` and `val2` doesn't :
-: : : exceed the given absolute :
-: : : error :
+| Fatal assertion | Nonfatal assertion | Verifies |
+| ------------------------------------- | ------------------------------------- | ------------------------- |
+| `ASSERT_NEAR(val1, val2, abs_error);` | `EXPECT_NEAR(val1, val2, abs_error);` | the difference between `val1` and `val2` doesn't exceed the given absolute error |
**Availability**: Linux, Windows, Mac.
@@ -382,15 +375,14 @@ Verifies that `val1` is less than, or almost equal to, `val2`. You can replace
### Asserting Using gMock Matchers
-Google-developed C++ mocking framework [gMock](http://go/gmock) comes with a
+Google-developed C++ mocking framework [gMock](../../googlemock) comes with a
library of matchers for validating arguments passed to mock objects. A gMock
*matcher* is basically a predicate that knows how to describe itself. It can be
used in these assertion macros:
-| Fatal assertion | Nonfatal assertion | Verifies |
-| ------------------- | ------------------------------ | --------------------- |
-| `ASSERT_THAT(value, | `EXPECT_THAT(value, matcher);` | value matches matcher |
-: matcher);` : : :
+| Fatal assertion | Nonfatal assertion | Verifies |
+| ------------------------------ | ------------------------------ | --------------------- |
+| `ASSERT_THAT(value, matcher);` | `EXPECT_THAT(value, matcher);` | value matches matcher |
For example, `StartsWith(prefix)` is a matcher that matches a string starting
with `prefix`, and you can write:
@@ -402,17 +394,17 @@ using ::testing::StartsWith;
EXPECT_THAT(Foo(), StartsWith("Hello"));
```
-Read this [recipe](http://go/gmockguide#using-matchers-in-gunit-assertions) in
+Read this [recipe](../../googlemock/docs/CookBook.md#using-matchers-in-google-test-assertions) in
the gMock Cookbook for more details.
gMock has a rich set of matchers. You can do many things googletest cannot do
alone with them. For a list of matchers gMock provides, read
-[this](http://go/gmockguide#using-matchers). Especially useful among them are
-some [protocol buffer matchers](http://go/protomatchers). It's easy to write
-your [own matchers](http://go/gmockguide#NewMatchers) too.
+[this](../../googlemock/docs/CookBook.md#using-matchers). Especially useful among them are
+some [protocol buffer matchers](https://github.com/google/nucleus/blob/master/nucleus/testing/protocol-buffer-matchers.h). It's easy to write
+your [own matchers](../../googlemock/docs/CookBook.md#writing-new-matchers-quickly) too.
For example, you can use gMock's
-[EqualsProto](http://cs/#piper///depot/google3/testing/base/public/gmock_utils/protocol-buffer-matchers.h)
+[EqualsProto](https://github.com/google/nucleus/blob/master/nucleus/testing/protocol-buffer-matchers.h)
to compare protos in your tests:
```c++
@@ -433,7 +425,7 @@ and you're ready to go.
(Please read the [previous](#AssertThat) section first if you haven't.)
-You can use the gMock [string matchers](http://go/gmockguide#string-matchers)
+You can use the gMock [string matchers](../../googlemock/docs/CheatSheet.md#string-matchers)
with `EXPECT_THAT()` or `ASSERT_THAT()` to do more string comparison tricks
(sub-string, prefix, suffix, regular expression, and etc). For example,
@@ -580,7 +572,7 @@ namespace foo {
class Bar { // We want googletest to be able to print instances of this.
...
// Create a free inline friend function.
- friend ::std::ostream& operator<<(::std::ostream& os, const Bar& bar) {
+ friend std::ostream& operator<<(std::ostream& os, const Bar& bar) {
return os << bar.DebugString(); // whatever needed to print bar to os
}
};
@@ -588,7 +580,7 @@ class Bar { // We want googletest to be able to print instances of this.
// If you can't declare the function in the class it's important that the
// << operator is defined in the SAME namespace that defines Bar. C++'s look-up
// rules rely on that.
-::std::ostream& operator<<(::std::ostream& os, const Bar& bar) {
+std::ostream& operator<<(std::ostream& os, const Bar& bar) {
return os << bar.DebugString(); // whatever needed to print bar to os
}
@@ -609,7 +601,7 @@ namespace foo {
class Bar {
...
- friend void PrintTo(const Bar& bar, ::std::ostream* os) {
+ friend void PrintTo(const Bar& bar, std::ostream* os) {
*os << bar.DebugString(); // whatever needed to print bar to os
}
};
@@ -617,7 +609,7 @@ class Bar {
// If you can't declare the function in the class it's important that PrintTo()
// is defined in the SAME namespace that defines Bar. C++'s look-up rules rely
// on that.
-void PrintTo(const Bar& bar, ::std::ostream* os) {
+void PrintTo(const Bar& bar, std::ostream* os) {
*os << bar.DebugString(); // whatever needed to print bar to os
}
@@ -657,7 +649,7 @@ _death tests_. More generally, any test that checks that a program terminates
Note that if a piece of code throws an exception, we don't consider it "death"
for the purpose of death tests, as the caller of the code could catch the
exception and avoid the crash. If you want to verify exceptions thrown by your
-code, see [Exception Assertions](#ExceptionAssertions).
+code, see [Exception Assertions](#exception-assertions).
If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see
Catching Failures
@@ -1155,7 +1147,7 @@ test has at least one failure of either kind.
In your test code, you can call `RecordProperty("key", value)` to log additional
information, where `value` can be either a string or an `int`. The *last* value
-recorded for a key will be emitted to the [XML output](#XmlReport) if you
+recorded for a key will be emitted to the [XML output](#generating-an-xml-report) if you
specify one. For example, the test
```c++
@@ -1396,17 +1388,11 @@ namespace:
| Parameter Generator | Behavior |
| ---------------------------- | ------------------------------------------- |
-| `Range(begin, end [, step])` | Yields values `{begin, begin+step, |
-: : begin+step+step, ...}`. The values do not :
-: : include `end`. `step` defaults to 1. :
+| `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. |
| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. |
-| `ValuesIn(container)` and | Yields values from a C-style array, an |
-: `ValuesIn(begin,end)` : STL-style container, or an iterator range :
-: : `[begin, end)`. :
+| `ValuesIn(container)` and `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. |
| `Bool()` | Yields sequence `{false, true}`. |
-| `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) |
-: : as std\:\:tuples of the values generated by :
-: : the `N` generators. :
+| `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) as std\:\:tuples of the values generated by the `N` generators. |
For more details, see the comments at the definitions of these functions.
@@ -1438,7 +1424,7 @@ will have these names:
* `InstantiationName/FooTest.HasBlahBlah/1` for `"miny"`
* `InstantiationName/FooTest.HasBlahBlah/2` for `"moe"`
-You can use these names in [`--gtest_filter`](#TestFilter).
+You can use these names in [`--gtest_filter`](#running-a-subset-of-the-tests).
This statement will instantiate all tests from `FooTest` again, each with
parameter values `"cat"` and `"dog"`:
@@ -1688,7 +1674,7 @@ To test them, we use the following special techniques:
* Both static functions and definitions/declarations in an unnamed namespace
are only visible within the same translation unit. To test them, you can
`#include` the entire `.cc` file being tested in your `*_test.cc` file.
- (#including `.cc` files is not a good way to reuse code - you should not do
+ (including `.cc` files is not a good way to reuse code - you should not do
this in production code!)
However, a better approach is to move the private code into the
@@ -1726,11 +1712,11 @@ To test them, we use the following special techniques:
```c++
// foo.h
-#include "gtest/gtest_prod.h"
+ #include "gtest/gtest_prod.h"
class Foo {
...
- private:
+ private:
FRIEND_TEST(FooTest, BarReturnsZeroOnNull);
int Bar(void* x);
@@ -1779,7 +1765,7 @@ To test them, we use the following special techniques:
```
- ## "Catching" Failures
+## "Catching" Failures
If you are building a testing utility on top of googletest, you'll want to test
your utility. What framework would you use to test it? googletest, of course.
@@ -2134,7 +2120,7 @@ $ foo_test --gtest_repeat=1000 --gtest_filter=FooBar.*
Repeat the tests whose name matches the filter 1000 times.
```
-If your test program contains [global set-up/tear-down](#GlobalSetUp) code, it
+If your test program contains [global set-up/tear-down](#global-set-up-and-tear-down) code, it
will be repeated in each iteration as well, as the flakiness may be in it. You
can also specify the repeat count by setting the `GTEST_REPEAT` environment
variable.
@@ -2168,23 +2154,22 @@ random seed and re-shuffle the tests in each iteration.
googletest can use colors in its terminal output to make it easier to spot the
important information:
-...
-<span style="color:green">[----------]<span style="color:black"> 1 test from FooTest
-<span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc
-<span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc
-<span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest
-<span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty
-<span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty
-<span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess
-... some error messages ...
-<span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess
-...
-<span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran.
-<span style="color:green">[ PASSED ]<span style="color:black"> 28 tests.
-<span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below:
-<span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess
-<span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz
-
+...<br/>
+<span style="color:green">[----------]<span style="color:black"> 1 test from FooTest<br/>
+<span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc<br/>
+<span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc<br/>
+<span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest<br/>
+<span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty<br/>
+<span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty<br/>
+<span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
+... some error messages ...<br/>
+<span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess<br/>
+...<br/>
+<span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran.<br/>
+<span style="color:green">[ PASSED ]<span style="color:black"> 28 tests.<br/>
+<span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below:<br/>
+<span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
+<span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz<br/>
2 FAILED TESTS
You can set the `GTEST_COLOR` environment variable or the `--gtest_color`
@@ -2193,8 +2178,7 @@ disable colors, or let googletest decide. When the value is `auto`, googletest
will use colors if and only if the output goes to a terminal and (on non-Windows
platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`.
->
-> **Availability**: Linux, Windows, Mac.
+ **Availability**: Linux, Windows, Mac.
#### Suppressing the Elapsed Time
diff --git a/googletest/docs/faq.md b/googletest/docs/faq.md
index dad28369..7d42ff7d 100644
--- a/googletest/docs/faq.md
+++ b/googletest/docs/faq.md
@@ -162,7 +162,7 @@ result, any in-memory side effects they incur are observable in their respective
sub-processes, but not in the parent process. You can think of them as running
in a parallel universe, more or less.
-In particular, if you use [gMock](http://go/gmock) and the death test statement
+In particular, if you use [gMock](../../googlemock) and the death test statement
invokes some mock methods, the parent process will think the calls have never
occurred. Therefore, you may want to move your `EXPECT_CALL` statements inside
the `EXPECT_DEATH` macro.
@@ -289,7 +289,7 @@ Please make sure you have read [this](advanced.md#how-it-works).
In particular, death tests don't like having multiple threads in the parent
process. So the first thing you can try is to eliminate creating threads outside
-of `EXPECT_DEATH()`. For example, you may want to use [mocks](http://go/gmock)
+of `EXPECT_DEATH()`. For example, you may want to use [mocks](../../googlemock)
or fake objects instead of real ones in your tests.
Sometimes this is impossible as some library you must use may be creating
@@ -704,11 +704,12 @@ mistake in production. Such cleverness also leads to
advise against the practice, and googletest doesn't provide a way to do it.
In general, the recommended way to cause the code to behave differently under
-test is [Dependency Injection](http://go/dependency-injection). You can inject
+test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject
different functionality from the test and from the production code. Since your
production code doesn't link in the for-test logic at all (the
-[`testonly`](http://go/testonly) attribute for BUILD targets helps to ensure
-that), there is no danger in accidentally running it.
+[`testonly`](https://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly)
+attribute for BUILD targets helps to ensure that), there is no danger in
+accidentally running it.
However, if you *really*, *really*, *really* have no choice, and if you follow
the rule of ending your test program names with `_test`, you can use the
diff --git a/googletest/docs/primer.md b/googletest/docs/primer.md
index 260d50b8..7a8ea8d7 100644
--- a/googletest/docs/primer.md
+++ b/googletest/docs/primer.md
@@ -5,8 +5,8 @@
*googletest* helps you write better C++ tests.
-googletest is a testing framework developed by the [Testing
-Technology](http://engdoc/eng/testing/TT/) team with Google's specific
+googletest is a testing framework developed by the Testing
+Technology team with Google's specific
requirements and constraints in mind. No matter whether you work on Linux,
Windows, or a Mac, if you write C++ code, googletest can help you. And it
supports *any* kind of tests, not just unit tests.
@@ -75,7 +75,7 @@ the terms:
Meaning | googletest Term | [ISTQB](http://www.istqb.org/) Term
:----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------- | :----------------------------------
Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case](http://glossary.istqb.org/search/test%20case)
-A set of several tests related to one component | [TestCase](https://g3doc.corp.google.com/third_party/googletest/googletest/g3doc/primer.md#basic-concepts) | [TestSuite](http://glossary.istqb.org/search/test%20suite)
+A set of several tests related to one component | [TestCase](#basic-concepts) | [TestSuite](http://glossary.istqb.org/search/test%20suite)
## Basic Concepts
@@ -317,7 +317,7 @@ To create a fixture:
1. If necessary, write a destructor or `TearDown()` function to release any
resources you allocated in `SetUp()` . To learn when you should use the
constructor/destructor and when you should use `SetUp()/TearDown()`, read
- this [FAQ](faq.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function) entry.
+ this [FAQ](faq.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-setupteardown) entry.
1. If needed, define subroutines for your tests to share.
When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
diff --git a/googletest/include/gtest/gtest-death-test.h b/googletest/include/gtest/gtest-death-test.h
index 53f11d4c..20c54d86 100644
--- a/googletest/include/gtest/gtest-death-test.h
+++ b/googletest/include/gtest/gtest-death-test.h
@@ -26,14 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file defines the public API for death tests. It is
// #included by gtest.h so a user doesn't need to include this
// directly.
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
@@ -99,6 +99,7 @@ GTEST_API_ bool InDeathTestChild();
//
// On the regular expressions used in death tests:
//
+// GOOGLETEST_CM0005 DO NOT DELETE
// On POSIX-compliant systems (*nix), we use the <regex.h> library,
// which uses the POSIX extended regex syntax.
//
@@ -160,7 +161,7 @@ GTEST_API_ bool InDeathTestChild();
// is rarely a problem as people usually don't put the test binary
// directory in PATH.
//
-// TODO(wan@google.com): make thread-safe death tests search the PATH.
+// FIXME: make thread-safe death tests search the PATH.
// Asserts that a given statement causes the program to exit, with an
// integer exit status that satisfies predicate, and emitting error output
@@ -201,6 +202,7 @@ class GTEST_API_ ExitedWithCode {
# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
// Tests that an exit code describes an exit due to termination by a
// given signal.
+// GOOGLETEST_CM0006 DO NOT DELETE
class GTEST_API_ KilledBySignal {
public:
explicit KilledBySignal(int signum);
diff --git a/googletest/include/gtest/gtest-message.h b/googletest/include/gtest/gtest-message.h
index d7266baa..5ca04161 100644
--- a/googletest/include/gtest/gtest-message.h
+++ b/googletest/include/gtest/gtest-message.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
@@ -43,6 +42,8 @@
// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
// program!
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
@@ -50,6 +51,9 @@
#include "gtest/internal/gtest-port.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
// Ensures that there is at least one operator<< in the global namespace.
// See Message& operator<<(...) below for why.
void operator<<(const testing::internal::Secret&, int);
@@ -246,4 +250,6 @@ std::string StreamableToString(const T& streamable) {
} // namespace internal
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/googletest/include/gtest/gtest-param-test.h b/googletest/include/gtest/gtest-param-test.h
index 8993c1ce..3e95e439 100644
--- a/googletest/include/gtest/gtest-param-test.h
+++ b/googletest/include/gtest/gtest-param-test.h
@@ -31,14 +31,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev)
-//
// Macros and functions for implementing parameterized tests
// in Google C++ Testing and Mocking Framework (Google Test)
//
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
//
-
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
@@ -1412,26 +1410,24 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
// alphanumeric characters or underscore. Because PrintToString adds quotes
// to std::string and C strings, it won't work for these types.
-#define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
- static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
- gtest_##prefix##test_case_name##_EvalGenerator_() { \
- return generator; \
- } \
- static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
- const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
- return ::testing::internal::GetParamNameGen<test_case_name::ParamType>( \
- __VA_ARGS__)(info); \
- } \
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
+ static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+ gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
+ static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+ const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+ return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+ (__VA_ARGS__)(info); \
+ } \
static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::UnitTest::GetInstance() \
- ->parameterized_test_registry() \
- .GetTestCasePatternHolder<test_case_name>( \
- #test_case_name, \
- ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
- ->AddTestCaseInstantiation( \
- #prefix, &gtest_##prefix##test_case_name##_EvalGenerator_, \
- &gtest_##prefix##test_case_name##_EvalGenerateName_, __FILE__, \
- __LINE__)
+ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+ GetTestCasePatternHolder<test_case_name>(\
+ #test_case_name, \
+ ::testing::internal::CodeLocation(\
+ __FILE__, __LINE__))->AddTestCaseInstantiation(\
+ #prefix, \
+ &gtest_##prefix##test_case_name##_EvalGenerator_, \
+ &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+ __FILE__, __LINE__)
} // namespace testing
diff --git a/googletest/include/gtest/gtest-param-test.h.pump b/googletest/include/gtest/gtest-param-test.h.pump
index 7b7243f3..274f2b3b 100644
--- a/googletest/include/gtest/gtest-param-test.h.pump
+++ b/googletest/include/gtest/gtest-param-test.h.pump
@@ -30,13 +30,12 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev)
-//
// Macros and functions for implementing parameterized tests
// in Google C++ Testing and Mocking Framework (Google Test)
//
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
//
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
index 66d54b94..51865f84 100644
--- a/googletest/include/gtest/gtest-printers.h
+++ b/googletest/include/gtest/gtest-printers.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Test - The Google C++ Testing and Mocking Framework
//
@@ -96,6 +95,8 @@
// being defined as many user-defined container types don't have
// value_type.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
@@ -825,7 +826,7 @@ void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
// If the array has more than kThreshold elements, we'll have to
// omit some details by printing only the first and the last
// kChunkSize elements.
- // TODO(wan@google.com): let the user control the threshold using a flag.
+ // FIXME: let the user control the threshold using a flag.
if (len <= kThreshold) {
PrintRawArrayTo(begin, len, os);
} else {
@@ -977,12 +978,13 @@ struct TuplePolicy {
static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
template <size_t I>
- struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
+ struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
+ };
template <size_t I>
- static typename AddReference<
- const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
- const Tuple& tuple) {
+ static typename AddReference<const typename ::std::tr1::tuple_element<
+ static_cast<int>(I), Tuple>::type>::type
+ get(const Tuple& tuple) {
return ::std::tr1::get<I>(tuple);
}
};
diff --git a/googletest/include/gtest/gtest-spi.h b/googletest/include/gtest/gtest-spi.h
index 0e5c10cf..1e898393 100644
--- a/googletest/include/gtest/gtest-spi.h
+++ b/googletest/include/gtest/gtest-spi.h
@@ -26,17 +26,21 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Utilities for testing Google Test itself and code that uses Google Test
// (e.g. frameworks built on top of Google Test).
+// GOOGLETEST_CM0004 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_
#include "gtest/gtest.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
// This helper class can be used to mock out Google Test failure reporting
@@ -111,6 +115,8 @@ class GTEST_API_ SingleFailureChecker {
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
// A set of macros for testing Google Test assertions or code that's expected
// to generate Google Test fatal failures. It verifies that the given
// statement will cause exactly one fatal Google Test failure with 'substr'
diff --git a/googletest/include/gtest/gtest-test-part.h b/googletest/include/gtest/gtest-test-part.h
index 77eb8448..1c7b89e0 100644
--- a/googletest/include/gtest/gtest-test-part.h
+++ b/googletest/include/gtest/gtest-test-part.h
@@ -27,8 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Author: mheule@google.com (Markus Heule)
-//
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
@@ -38,6 +37,9 @@
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
// A copyable object representing the result of a test part (i.e. an
@@ -143,7 +145,7 @@ class GTEST_API_ TestPartResultArray {
};
// This interface knows how to report a test part result.
-class TestPartResultReporterInterface {
+class GTEST_API_ TestPartResultReporterInterface {
public:
virtual ~TestPartResultReporterInterface() {}
@@ -176,4 +178,6 @@ class GTEST_API_ HasNewFatalFailureHelper
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h
index 759d1dbd..74bce46b 100644
--- a/googletest/include/gtest/gtest-typed-test.h
+++ b/googletest/include/gtest/gtest-typed-test.h
@@ -26,8 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
+
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
@@ -82,6 +83,24 @@ TYPED_TEST(FooTest, DoesBlah) {
TYPED_TEST(FooTest, HasPropertyA) { ... }
+// TYPED_TEST_CASE takes an optional third argument which allows to specify a
+// class that generates custom test name suffixes based on the type. This should
+// be a class which has a static template function GetName(int index) returning
+// a string for each type. The provided integer index equals the index of the
+// type in the provided type list. In many cases the index can be ignored.
+//
+// For example:
+// class MyTypeNames {
+// public:
+// template <typename T>
+// static std::string GetName(int) {
+// if (std::is_same<T, char>()) return "char";
+// if (std::is_same<T, int>()) return "int";
+// if (std::is_same<T, unsigned int>()) return "unsignedInt";
+// }
+// };
+// TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
+
#endif // 0
// Type-parameterized tests are abstract test patterns parameterized
@@ -143,6 +162,11 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
// If the type list contains only one type, you can write that type
// directly without Types<...>:
// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
+//
+// Similar to the optional argument of TYPED_TEST_CASE above,
+// INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to
+// generate custom names.
+// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);
#endif // 0
@@ -159,32 +183,46 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
// given test case.
# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
+// Expands to the name of the typedef for the NameGenerator, responsible for
+// creating the suffixes of the name.
+#define GTEST_NAME_GENERATOR_(TestCaseName) \
+ gtest_type_params_##TestCaseName##_NameGenerator
+
// The 'Types' template argument below must have spaces around it
// since some compilers may choke on '>>' when passing a template
// instance (e.g. Types<int>)
-# define TYPED_TEST_CASE(CaseName, Types) \
- typedef ::testing::internal::TypeList< Types >::type \
- GTEST_TYPE_PARAMS_(CaseName)
-
-# define TYPED_TEST(CaseName, TestName) \
- template <typename gtest_TypeParam_> \
- class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
- : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
- }; \
- bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::internal::TypeParameterizedTest< \
- CaseName, \
- ::testing::internal::TemplateSel< \
- GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
- GTEST_TYPE_PARAMS_(CaseName)>::Register(\
- "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
- #CaseName, #TestName, 0); \
- template <typename gtest_TypeParam_> \
- void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+# define TYPED_TEST_CASE(CaseName, Types, ...) \
+ typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \
+ CaseName); \
+ typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
+ GTEST_NAME_GENERATOR_(CaseName)
+
+# define TYPED_TEST(CaseName, TestName) \
+ template <typename gtest_TypeParam_> \
+ class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
+ : public CaseName<gtest_TypeParam_> { \
+ private: \
+ typedef CaseName<gtest_TypeParam_> TestFixture; \
+ typedef gtest_TypeParam_ TypeParam; \
+ virtual void TestBody(); \
+ }; \
+ static bool gtest_##CaseName##_##TestName##_registered_ \
+ GTEST_ATTRIBUTE_UNUSED_ = \
+ ::testing::internal::TypeParameterizedTest< \
+ CaseName, \
+ ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \
+ TestName)>, \
+ GTEST_TYPE_PARAMS_( \
+ CaseName)>::Register("", \
+ ::testing::internal::CodeLocation( \
+ __FILE__, __LINE__), \
+ #CaseName, #TestName, 0, \
+ ::testing::internal::GenerateNames< \
+ GTEST_NAME_GENERATOR_(CaseName), \
+ GTEST_TYPE_PARAMS_(CaseName)>()); \
+ template <typename gtest_TypeParam_> \
+ void GTEST_TEST_CLASS_NAME_(CaseName, \
+ TestName)<gtest_TypeParam_>::TestBody()
#endif // GTEST_HAS_TYPED_TEST
@@ -249,15 +287,19 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
// The 'Types' template argument below must have spaces around it
// since some compilers may choke on '>>' when passing a template
// instance (e.g. Types<int>)
-# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
- bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::internal::TypeParameterizedTestCase<CaseName, \
- GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
- ::testing::internal::TypeList< Types >::type>::Register(\
- #Prefix, \
- ::testing::internal::CodeLocation(__FILE__, __LINE__), \
- &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
- #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...) \
+ static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
+ ::testing::internal::TypeParameterizedTestCase< \
+ CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
+ ::testing::internal::TypeList< Types >::type>:: \
+ Register(#Prefix, \
+ ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+ &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName, \
+ GTEST_REGISTERED_TEST_NAMES_(CaseName), \
+ ::testing::internal::GenerateNames< \
+ ::testing::internal::NameGeneratorSelector< \
+ __VA_ARGS__>::type, \
+ ::testing::internal::TypeList< Types >::type>())
#endif // GTEST_HAS_TYPED_TEST_P
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 686750e0..5df4b0a3 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
@@ -48,6 +47,8 @@
// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
// easyUnit framework.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_H_
@@ -65,6 +66,9 @@
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-typed-test.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
// Depending on the platform, different string classes are available.
// On Linux, in addition to ::std::string, Google also makes use of
// class ::string, which has the same interface as ::std::string, but
@@ -112,6 +116,10 @@ GTEST_DECLARE_string_(color);
// the tests to run. If the filter is not given all tests are executed.
GTEST_DECLARE_string_(filter);
+// This flag controls whether Google Test installs a signal handler that dumps
+// debugging information when fatal signals are raised.
+GTEST_DECLARE_bool_(install_failure_signal_handler);
+
// This flag causes the Google Test to list tests. None of the tests listed
// are actually run if the flag is provided.
GTEST_DECLARE_bool_(list_tests);
@@ -155,6 +163,10 @@ GTEST_DECLARE_bool_(throw_on_failure);
// the specified host machine.
GTEST_DECLARE_string_(stream_result_to);
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+GTEST_DECLARE_string_(flagfile);
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
+
// The upper limit for valid stack trace depths.
const int kMaxStackTraceDepth = 100;
@@ -314,7 +326,7 @@ class GTEST_API_ AssertionResult {
const char* message() const {
return message_.get() != NULL ? message_->c_str() : "";
}
- // TODO(vladl@google.com): Remove this after making sure no clients use it.
+ // FIXME: Remove this after making sure no clients use it.
// Deprecated; please use message() instead.
const char* failure_message() const { return message(); }
@@ -620,7 +632,7 @@ class GTEST_API_ TestResult {
// Adds a failure if the key is a reserved attribute of Google Test
// testcase tags. Returns true if the property is valid.
- // TODO(russr): Validate attribute names are legal and human readable.
+ // FIXME: Validate attribute names are legal and human readable.
static bool ValidateTestProperty(const std::string& xml_element,
const TestProperty& test_property);
@@ -2329,4 +2341,6 @@ inline int RUN_ALL_TESTS() {
return ::testing::UnitTest::GetInstance()->Run();
}
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GTEST_INCLUDE_GTEST_GTEST_H_
diff --git a/googletest/include/gtest/gtest_pred_impl.h b/googletest/include/gtest/gtest_pred_impl.h
index c8be230e..0c1105cb 100644
--- a/googletest/include/gtest/gtest_pred_impl.h
+++ b/googletest/include/gtest/gtest_pred_impl.h
@@ -32,6 +32,8 @@
//
// Implements a family of generic predicate assertion macros.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/googletest/include/gtest/gtest_prod.h b/googletest/include/gtest/gtest_prod.h
index 89314f40..e651671e 100644
--- a/googletest/include/gtest/gtest_prod.h
+++ b/googletest/include/gtest/gtest_prod.h
@@ -26,10 +26,10 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Google C++ Testing and Mocking Framework definitions useful in production code.
+// GOOGLETEST_CM0003 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/googletest/include/gtest/internal/custom/README.md b/googletest/include/gtest/internal/custom/README.md
new file mode 100644
index 00000000..ff391fb4
--- /dev/null
+++ b/googletest/include/gtest/internal/custom/README.md
@@ -0,0 +1,56 @@
+# Customization Points
+
+The custom directory is an injection point for custom user configurations.
+
+## Header `gtest.h`
+
+### The following macros can be defined:
+
+* `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of
+ `OsStackTraceGetterInterface`.
+* `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See
+ `testing::TempDir` for semantics and signature.
+
+## Header `gtest-port.h`
+
+The following macros can be defined:
+
+### Flag related macros:
+
+* `GTEST_FLAG(flag_name)`
+* `GTEST_USE_OWN_FLAGFILE_FLAG_` - Define to 0 when the system provides its
+ own flagfile flag parsing.
+* `GTEST_DECLARE_bool_(name)`
+* `GTEST_DECLARE_int32_(name)`
+* `GTEST_DECLARE_string_(name)`
+* `GTEST_DEFINE_bool_(name, default_val, doc)`
+* `GTEST_DEFINE_int32_(name, default_val, doc)`
+* `GTEST_DEFINE_string_(name, default_val, doc)`
+
+### Logging:
+
+* `GTEST_LOG_(severity)`
+* `GTEST_CHECK_(condition)`
+* Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too.
+
+### Threading:
+
+* `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided.
+* `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal`
+ are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)`
+ and `GTEST_DEFINE_STATIC_MUTEX_(mutex)`
+* `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)`
+* `GTEST_LOCK_EXCLUDED_(locks)`
+
+### Underlying library support features
+
+* `GTEST_HAS_CXXABI_H_`
+
+### Exporting API symbols:
+
+* `GTEST_API_` - Specifier for exported symbols.
+
+## Header `gtest-printers.h`
+
+* See documentation at `gtest/gtest-printers.h` for details on how to define a
+ custom printer.
diff --git a/googletest/include/gtest/internal/custom/gtest-port.h b/googletest/include/gtest/internal/custom/gtest-port.h
index aa5da295..cd85d956 100644
--- a/googletest/include/gtest/internal/custom/gtest-port.h
+++ b/googletest/include/gtest/internal/custom/gtest-port.h
@@ -27,40 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Injection point for custom user configurations.
-// The following macros can be defined:
-//
-// Flag related macros:
-// GTEST_FLAG(flag_name)
-// GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its
-// own flagfile flag parsing.
-// GTEST_DECLARE_bool_(name)
-// GTEST_DECLARE_int32_(name)
-// GTEST_DECLARE_string_(name)
-// GTEST_DEFINE_bool_(name, default_val, doc)
-// GTEST_DEFINE_int32_(name, default_val, doc)
-// GTEST_DEFINE_string_(name, default_val, doc)
-//
-// Logging:
-// GTEST_LOG_(severity)
-// GTEST_CHECK_(condition)
-// Functions LogToStderr() and FlushInfoLog() have to be provided too.
-//
-// Threading:
-// GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
-// GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
-// already provided.
-// Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
-// GTEST_DEFINE_STATIC_MUTEX_(mutex)
-//
-// GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
-// GTEST_LOCK_EXCLUDED_(locks)
-//
-// Underlying library support features:
-// GTEST_HAS_CXXABI_H_
-//
-// Exporting API symbols:
-// GTEST_API_ - Specifier for exported symbols.
+// Injection point for custom user configurations. See README for details
//
// ** Custom implementation starts here **
diff --git a/googletest/include/gtest/internal/custom/gtest-printers.h b/googletest/include/gtest/internal/custom/gtest-printers.h
index 60c1ea05..eb4467ab 100644
--- a/googletest/include/gtest/internal/custom/gtest-printers.h
+++ b/googletest/include/gtest/internal/custom/gtest-printers.h
@@ -31,8 +31,8 @@
// installation of gTest.
// It will be included from gtest-printers.h and the overrides in this file
// will be visible to everyone.
-// See documentation at gtest/gtest-printers.h for details on how to define a
-// custom printer.
+//
+// Injection point for custom user configurations. See README for details
//
// ** Custom implementation starts here **
diff --git a/googletest/include/gtest/internal/custom/gtest.h b/googletest/include/gtest/internal/custom/gtest.h
index aa51f60e..4dd2d1fd 100644
--- a/googletest/include/gtest/internal/custom/gtest.h
+++ b/googletest/include/gtest/internal/custom/gtest.h
@@ -27,15 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Injection point for custom user configurations.
-// The following macros can be defined:
-//
-// GTEST_OS_STACK_TRACE_GETTER_ - The name of an implementation of
-// OsStackTraceGetterInterface.
-//
-// GTEST_CUSTOM_TEMPDIR_FUNCTION_ - An override for testing::TempDir().
-// See testing::TempDir for semantics and
-// signature.
+// Injection point for custom user configurations. See README for details
//
// ** Custom implementation starts here **
diff --git a/googletest/include/gtest/internal/gtest-death-test-internal.h b/googletest/include/gtest/internal/gtest-death-test-internal.h
index 949c4298..0a9b42c8 100644
--- a/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -27,11 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file defines internal utilities needed for implementing
// death tests. They are subject to change without notice.
+// GOOGLETEST_CM0001 DO NOT DELETE
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
@@ -52,6 +52,9 @@ const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
#if GTEST_HAS_DEATH_TEST
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
// DeathTest is a class that hides much of the complexity of the
// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
// returns a concrete class that depends on the prevailing death test
@@ -135,6 +138,8 @@ class GTEST_API_ DeathTest {
GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
};
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
// Factory interface for death tests. May be mocked out for testing.
class DeathTestFactory {
public:
diff --git a/googletest/include/gtest/internal/gtest-filepath.h b/googletest/include/gtest/internal/gtest-filepath.h
index 406597a4..ae38d95b 100644
--- a/googletest/include/gtest/internal/gtest-filepath.h
+++ b/googletest/include/gtest/internal/gtest-filepath.h
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// Google Test filepath utilities
//
// This header file declares classes and functions used internally by
@@ -36,11 +35,16 @@
// This file is #included in gtest/internal/gtest-internal.h.
// Do not include this header file separately!
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#include "gtest/internal/gtest-string.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
namespace internal {
@@ -202,4 +206,6 @@ class GTEST_API_ FilePath {
} // namespace internal
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index fc65b1f2..b762f61f 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -27,12 +27,13 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file declares functions and macros used internally by
// Google Test. They are subject to change without notice.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
@@ -140,6 +141,9 @@ GTEST_API_ std::string AppendUserMessage(
#if GTEST_HAS_EXCEPTIONS
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \
+/* an exported class was derived from a class that was not exported */)
+
// This exception is thrown by (and only by) a failed Google Test
// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
// are enabled). We derive it from std::runtime_error, which is for
@@ -151,6 +155,8 @@ class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
explicit GoogleTestFailureException(const TestPartResult& failure);
};
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4275
+
#endif // GTEST_HAS_EXCEPTIONS
namespace edit_distance {
@@ -527,6 +533,9 @@ GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
// State of the definition of a type-parameterized test case.
class GTEST_API_ TypedTestCasePState {
public:
@@ -572,6 +581,8 @@ class GTEST_API_ TypedTestCasePState {
RegisteredTestsMap registered_tests_;
};
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
// Skips to the first non-space char after the first comma in 'str';
// returns NULL if no comma is found in 'str'.
inline const char* SkipComma(const char* str) {
@@ -595,6 +606,37 @@ inline std::string GetPrefixUntilComma(const char* str) {
void SplitString(const ::std::string& str, char delimiter,
::std::vector< ::std::string>* dest);
+// The default argument to the template below for the case when the user does
+// not provide a name generator.
+struct DefaultNameGenerator {
+ template <typename T>
+ static std::string GetName(int i) {
+ return StreamableToString(i);
+ }
+};
+
+template <typename Provided = DefaultNameGenerator>
+struct NameGeneratorSelector {
+ typedef Provided type;
+};
+
+template <typename NameGenerator>
+void GenerateNamesRecursively(Types0, std::vector<std::string>*, int) {}
+
+template <typename NameGenerator, typename Types>
+void GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {
+ result->push_back(NameGenerator::template GetName<typename Types::Head>(i));
+ GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,
+ i + 1);
+}
+
+template <typename NameGenerator, typename Types>
+std::vector<std::string> GenerateNames() {
+ std::vector<std::string> result;
+ GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);
+ return result;
+}
+
// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
// registers a list of type-parameterized tests with Google Test. The
// return value is insignificant - we just need to return something
@@ -609,10 +651,10 @@ class TypeParameterizedTest {
// specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
// Types). Valid values for 'index' are [0, N - 1] where N is the
// length of Types.
- static bool Register(const char* prefix,
- const CodeLocation& code_location,
- const char* case_name, const char* test_names,
- int index) {
+ static bool Register(const char* prefix, const CodeLocation& code_location,
+ const char* case_name, const char* test_names, int index,
+ const std::vector<std::string>& type_names =
+ GenerateNames<DefaultNameGenerator, Types>()) {
typedef typename Types::Head Type;
typedef Fixture<Type> FixtureClass;
typedef typename GTEST_BIND_(TestSel, Type) TestClass;
@@ -620,20 +662,23 @@ class TypeParameterizedTest {
// First, registers the first type-parameterized test in the type
// list.
MakeAndRegisterTestInfo(
- (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
- + StreamableToString(index)).c_str(),
+ (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
+ "/" + type_names[index])
+ .c_str(),
StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
GetTypeName<Type>().c_str(),
NULL, // No value parameter.
- code_location,
- GetTypeId<FixtureClass>(),
- TestClass::SetUpTestCase,
- TestClass::TearDownTestCase,
- new TestFactoryImpl<TestClass>);
+ code_location, GetTypeId<FixtureClass>(), TestClass::SetUpTestCase,
+ TestClass::TearDownTestCase, new TestFactoryImpl<TestClass>);
// Next, recurses (at compile time) with the tail of the type list.
- return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
- ::Register(prefix, code_location, case_name, test_names, index + 1);
+ return TypeParameterizedTest<Fixture, TestSel,
+ typename Types::Tail>::Register(prefix,
+ code_location,
+ case_name,
+ test_names,
+ index + 1,
+ type_names);
}
};
@@ -643,7 +688,9 @@ class TypeParameterizedTest<Fixture, TestSel, Types0> {
public:
static bool Register(const char* /*prefix*/, const CodeLocation&,
const char* /*case_name*/, const char* /*test_names*/,
- int /*index*/) {
+ int /*index*/,
+ const std::vector<std::string>& =
+ std::vector<std::string>() /*type_names*/) {
return true;
}
};
@@ -656,8 +703,10 @@ template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
class TypeParameterizedTestCase {
public:
static bool Register(const char* prefix, CodeLocation code_location,
- const TypedTestCasePState* state,
- const char* case_name, const char* test_names) {
+ const TypedTestCasePState* state, const char* case_name,
+ const char* test_names,
+ const std::vector<std::string>& type_names =
+ GenerateNames<DefaultNameGenerator, Types>()) {
std::string test_name = StripTrailingSpaces(
GetPrefixUntilComma(test_names));
if (!state->TestExists(test_name)) {
@@ -674,12 +723,14 @@ class TypeParameterizedTestCase {
// First, register the first test in 'Test' for each type in 'Types'.
TypeParameterizedTest<Fixture, Head, Types>::Register(
- prefix, test_location, case_name, test_names, 0);
+ prefix, test_location, case_name, test_names, 0, type_names);
// Next, recurses (at compile time) with the tail of the test list.
- return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
- ::Register(prefix, code_location, state,
- case_name, SkipComma(test_names));
+ return TypeParameterizedTestCase<Fixture, typename Tests::Tail,
+ Types>::Register(prefix, code_location,
+ state, case_name,
+ SkipComma(test_names),
+ type_names);
}
};
@@ -689,7 +740,9 @@ class TypeParameterizedTestCase<Fixture, Templates0, Types> {
public:
static bool Register(const char* /*prefix*/, const CodeLocation&,
const TypedTestCasePState* /*state*/,
- const char* /*case_name*/, const char* /*test_names*/) {
+ const char* /*case_name*/, const char* /*test_names*/,
+ const std::vector<std::string>& =
+ std::vector<std::string>() /*type_names*/) {
return true;
}
};
diff --git a/googletest/include/gtest/internal/gtest-linked_ptr.h b/googletest/include/gtest/internal/gtest-linked_ptr.h
index 36029422..082b8728 100644
--- a/googletest/include/gtest/internal/gtest-linked_ptr.h
+++ b/googletest/include/gtest/internal/gtest-linked_ptr.h
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: Dan Egnor (egnor@google.com)
-//
// A "smart" pointer type with reference tracking. Every pointer to a
// particular object is kept on a circular linked list. When the last pointer
// to an object is destroyed or reassigned, the object is deleted.
@@ -62,9 +60,11 @@
// raw pointer (e.g. via get()) concurrently, and
// - it's safe to write to two linked_ptrs that point to the same
// shared object concurrently.
-// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
+// FIXME: rename this to safe_linked_ptr to avoid
// confusion with normal linked_ptr.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
diff --git a/googletest/include/gtest/internal/gtest-param-util-generated.h b/googletest/include/gtest/internal/gtest-param-util-generated.h
index dcf90c27..4fac8c02 100644
--- a/googletest/include/gtest/internal/gtest-param-util-generated.h
+++ b/googletest/include/gtest/internal/gtest-param-util-generated.h
@@ -30,8 +30,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// Type and function utilities for implementing parameterized tests.
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
@@ -43,6 +42,8 @@
// by the maximum arity of the implementation of tuple which is
// currently set at 10.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
@@ -79,6 +80,8 @@ class ValueArray1 {
return ValuesIn(array);
}
+ ValueArray1(const ValueArray1& other) : v1_(other.v1_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray1& other);
@@ -97,6 +100,8 @@ class ValueArray2 {
return ValuesIn(array);
}
+ ValueArray2(const ValueArray2& other) : v1_(other.v1_), v2_(other.v2_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray2& other);
@@ -117,6 +122,9 @@ class ValueArray3 {
return ValuesIn(array);
}
+ ValueArray3(const ValueArray3& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray3& other);
@@ -139,6 +147,9 @@ class ValueArray4 {
return ValuesIn(array);
}
+ ValueArray4(const ValueArray4& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray4& other);
@@ -162,6 +173,9 @@ class ValueArray5 {
return ValuesIn(array);
}
+ ValueArray5(const ValueArray5& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray5& other);
@@ -188,6 +202,9 @@ class ValueArray6 {
return ValuesIn(array);
}
+ ValueArray6(const ValueArray6& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray6& other);
@@ -215,6 +232,10 @@ class ValueArray7 {
return ValuesIn(array);
}
+ ValueArray7(const ValueArray7& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray7& other);
@@ -244,6 +265,10 @@ class ValueArray8 {
return ValuesIn(array);
}
+ ValueArray8(const ValueArray8& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray8& other);
@@ -275,6 +300,10 @@ class ValueArray9 {
return ValuesIn(array);
}
+ ValueArray9(const ValueArray9& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray9& other);
@@ -307,6 +336,10 @@ class ValueArray10 {
return ValuesIn(array);
}
+ ValueArray10(const ValueArray10& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray10& other);
@@ -341,6 +374,11 @@ class ValueArray11 {
return ValuesIn(array);
}
+ ValueArray11(const ValueArray11& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray11& other);
@@ -377,6 +415,11 @@ class ValueArray12 {
return ValuesIn(array);
}
+ ValueArray12(const ValueArray12& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray12& other);
@@ -415,6 +458,11 @@ class ValueArray13 {
return ValuesIn(array);
}
+ ValueArray13(const ValueArray13& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray13& other);
@@ -454,6 +502,11 @@ class ValueArray14 {
return ValuesIn(array);
}
+ ValueArray14(const ValueArray14& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray14& other);
@@ -495,6 +548,12 @@ class ValueArray15 {
return ValuesIn(array);
}
+ ValueArray15(const ValueArray15& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray15& other);
@@ -539,6 +598,12 @@ class ValueArray16 {
return ValuesIn(array);
}
+ ValueArray16(const ValueArray16& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray16& other);
@@ -584,6 +649,12 @@ class ValueArray17 {
return ValuesIn(array);
}
+ ValueArray17(const ValueArray17& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray17& other);
@@ -631,6 +702,12 @@ class ValueArray18 {
return ValuesIn(array);
}
+ ValueArray18(const ValueArray18& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray18& other);
@@ -679,6 +756,13 @@ class ValueArray19 {
return ValuesIn(array);
}
+ ValueArray19(const ValueArray19& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray19& other);
@@ -729,6 +813,13 @@ class ValueArray20 {
return ValuesIn(array);
}
+ ValueArray20(const ValueArray20& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray20& other);
@@ -782,6 +873,13 @@ class ValueArray21 {
return ValuesIn(array);
}
+ ValueArray21(const ValueArray21& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray21& other);
@@ -836,6 +934,13 @@ class ValueArray22 {
return ValuesIn(array);
}
+ ValueArray22(const ValueArray22& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray22& other);
@@ -892,6 +997,14 @@ class ValueArray23 {
return ValuesIn(array);
}
+ ValueArray23(const ValueArray23& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray23& other);
@@ -950,6 +1063,14 @@ class ValueArray24 {
return ValuesIn(array);
}
+ ValueArray24(const ValueArray24& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray24& other);
@@ -1009,6 +1130,14 @@ class ValueArray25 {
return ValuesIn(array);
}
+ ValueArray25(const ValueArray25& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray25& other);
@@ -1070,6 +1199,14 @@ class ValueArray26 {
return ValuesIn(array);
}
+ ValueArray26(const ValueArray26& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray26& other);
@@ -1134,6 +1271,15 @@ class ValueArray27 {
return ValuesIn(array);
}
+ ValueArray27(const ValueArray27& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray27& other);
@@ -1199,6 +1345,15 @@ class ValueArray28 {
return ValuesIn(array);
}
+ ValueArray28(const ValueArray28& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray28& other);
@@ -1265,6 +1420,15 @@ class ValueArray29 {
return ValuesIn(array);
}
+ ValueArray29(const ValueArray29& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray29& other);
@@ -1334,6 +1498,15 @@ class ValueArray30 {
return ValuesIn(array);
}
+ ValueArray30(const ValueArray30& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray30& other);
@@ -1405,6 +1578,16 @@ class ValueArray31 {
return ValuesIn(array);
}
+ ValueArray31(const ValueArray31& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray31& other);
@@ -1477,6 +1660,16 @@ class ValueArray32 {
return ValuesIn(array);
}
+ ValueArray32(const ValueArray32& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray32& other);
@@ -1552,6 +1745,16 @@ class ValueArray33 {
return ValuesIn(array);
}
+ ValueArray33(const ValueArray33& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray33& other);
@@ -1628,6 +1831,16 @@ class ValueArray34 {
return ValuesIn(array);
}
+ ValueArray34(const ValueArray34& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray34& other);
@@ -1705,6 +1918,17 @@ class ValueArray35 {
return ValuesIn(array);
}
+ ValueArray35(const ValueArray35& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray35& other);
@@ -1785,6 +2009,17 @@ class ValueArray36 {
return ValuesIn(array);
}
+ ValueArray36(const ValueArray36& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray36& other);
@@ -1867,6 +2102,17 @@ class ValueArray37 {
return ValuesIn(array);
}
+ ValueArray37(const ValueArray37& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray37& other);
@@ -1950,6 +2196,17 @@ class ValueArray38 {
return ValuesIn(array);
}
+ ValueArray38(const ValueArray38& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray38& other);
@@ -2035,6 +2292,18 @@ class ValueArray39 {
return ValuesIn(array);
}
+ ValueArray39(const ValueArray39& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray39& other);
@@ -2122,6 +2391,18 @@ class ValueArray40 {
return ValuesIn(array);
}
+ ValueArray40(const ValueArray40& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray40& other);
@@ -2211,6 +2492,18 @@ class ValueArray41 {
return ValuesIn(array);
}
+ ValueArray41(const ValueArray41& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray41& other);
@@ -2302,6 +2595,18 @@ class ValueArray42 {
return ValuesIn(array);
}
+ ValueArray42(const ValueArray42& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray42& other);
@@ -2394,6 +2699,19 @@ class ValueArray43 {
return ValuesIn(array);
}
+ ValueArray43(const ValueArray43& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray43& other);
@@ -2488,6 +2806,19 @@ class ValueArray44 {
return ValuesIn(array);
}
+ ValueArray44(const ValueArray44& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray44& other);
@@ -2584,6 +2915,19 @@ class ValueArray45 {
return ValuesIn(array);
}
+ ValueArray45(const ValueArray45& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray45& other);
@@ -2682,6 +3026,19 @@ class ValueArray46 {
return ValuesIn(array);
}
+ ValueArray46(const ValueArray46& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray46& other);
@@ -2782,6 +3139,20 @@ class ValueArray47 {
return ValuesIn(array);
}
+ ValueArray47(const ValueArray47& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
+ v47_(other.v47_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray47& other);
@@ -2884,6 +3255,20 @@ class ValueArray48 {
return ValuesIn(array);
}
+ ValueArray48(const ValueArray48& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
+ v47_(other.v47_), v48_(other.v48_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray48& other);
@@ -2987,6 +3372,20 @@ class ValueArray49 {
return ValuesIn(array);
}
+ ValueArray49(const ValueArray49& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
+ v47_(other.v47_), v48_(other.v48_), v49_(other.v49_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray49& other);
@@ -3091,6 +3490,20 @@ class ValueArray50 {
return ValuesIn(array);
}
+ ValueArray50(const ValueArray50& other) : v1_(other.v1_), v2_(other.v2_),
+ v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
+ v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
+ v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
+ v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
+ v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
+ v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
+ v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
+ v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
+ v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
+ v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
+ v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
+ v47_(other.v47_), v48_(other.v48_), v49_(other.v49_), v50_(other.v50_) {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray50& other);
diff --git a/googletest/include/gtest/internal/gtest-param-util-generated.h.pump b/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
index d65086a0..30dffe43 100644
--- a/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
+++ b/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -29,8 +29,7 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// Type and function utilities for implementing parameterized tests.
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
@@ -42,6 +41,8 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
// by the maximum arity of the implementation of tuple which is
// currently set at $maxtuple.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
@@ -82,6 +83,8 @@ class ValueArray$i {
return ValuesIn(array);
}
+ ValueArray$i(const ValueArray$i& other) : $for j, [[v$(j)_(other.v$(j)_)]] {}
+
private:
// No implementation - assignment is unsupported.
void operator=(const ValueArray$i& other);
diff --git a/googletest/include/gtest/internal/gtest-param-util.h b/googletest/include/gtest/internal/gtest-param-util.h
index 3c80863c..d64f620c 100644
--- a/googletest/include/gtest/internal/gtest-param-util.h
+++ b/googletest/include/gtest/internal/gtest-param-util.h
@@ -26,11 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// Type and function utilities for implementing parameterized tests.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index dbe703b5..786497d8 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: wan@google.com (Zhanyong Wan)
-//
// Low-level types and utilities for porting Google Test to various
// platforms. All macros ending with _ and symbols defined in an
// internal namespace are subject to change without notice. Code
@@ -40,6 +38,8 @@
// files are expected to #include this. Therefore, it cannot #include
// any other Google Test header.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
@@ -178,6 +178,7 @@
// GTEST_HAS_TYPED_TEST - typed tests
// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
// GTEST_IS_THREADSAFE - Google Test is thread-safe.
+// GOOGLETEST_CM0007 DO NOT DELETE
// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
// GTEST_HAS_POSIX_RE (see above) which users can
// define themselves.
@@ -229,6 +230,7 @@
// Regular expressions:
// RE - a simple regular expression class using the POSIX
// Extended Regular Expression syntax on UNIX-like platforms
+// GOOGLETEST_CM0008 DO NOT DELETE
// or a reduced regular exception syntax on other
// platforms, including Windows.
// Logging:
@@ -325,6 +327,22 @@
# define GTEST_DISABLE_MSC_WARNINGS_POP_()
#endif
+// Clang on Windows does not understand MSVC's pragma warning.
+// We need clang-specific way to disable function deprecation warning.
+#ifdef __clang__
+# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
+#define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
+ _Pragma("clang diagnostic pop")
+#else
+# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+# define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif
+
#ifndef GTEST_LANG_CXX11
// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
@@ -379,7 +397,8 @@
#if GTEST_LANG_CXX11
# define GTEST_HAS_STD_TUPLE_ 1
# if defined(__clang__)
-// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
+// Inspired by
+// https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros
# if defined(__has_include) && !__has_include(<tuple>)
# undef GTEST_HAS_STD_TUPLE_
# endif
@@ -391,7 +410,7 @@
# elif defined(__GLIBCXX__)
// Inspired by boost/config/stdlib/libstdcpp3.hpp,
// http://gcc.gnu.org/gcc-4.2/changes.html and
-// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
+// https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
# undef GTEST_HAS_STD_TUPLE_
# endif
@@ -528,7 +547,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#ifndef GTEST_HAS_STD_WSTRING
// The user didn't tell us whether ::std::wstring is available, so we need
// to figure it out.
-// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
+// FIXME: uses autoconf to detect whether ::std::wstring
// is available.
// Cygwin 1.7 and below doesn't support ::std::wstring.
@@ -740,7 +759,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
// which is #included by <tr1/tuple>, to not compile when RTTI is
// disabled. _TR1_FUNCTIONAL is the header guard for
-// <tr1/functional>. Hence the following #define is a hack to prevent
+// <tr1/functional>. Hence the following #define is used to prevent
// <tr1/functional> from being included.
# define _TR1_FUNCTIONAL 1
# include <tr1/tuple>
@@ -1245,7 +1264,7 @@ class GTEST_API_ RE {
// PartialMatch(str, re) returns true iff regular expression re
// matches a substring of str (including str itself).
//
- // TODO(wan@google.com): make FullMatch() and PartialMatch() work
+ // FIXME: make FullMatch() and PartialMatch() work
// when str contains NUL characters.
static bool FullMatch(const ::std::string& str, const RE& re) {
return FullMatch(str.c_str(), re);
@@ -1272,7 +1291,7 @@ class GTEST_API_ RE {
void Init(const char* regex);
// We use a const char* instead of an std::string, as Google Test used to be
- // used where std::string is not available. TODO(wan@google.com): change to
+ // used where std::string is not available. FIXME: change to
// std::string.
const char* pattern_;
bool is_valid_;
@@ -1799,7 +1818,7 @@ class GTEST_API_ Mutex {
// Initializes owner_thread_id_ and critical_section_ in static mutexes.
void ThreadSafeLazyInit();
- // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
+ // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,
// we assume that 0 is an invalid value for thread IDs.
unsigned int owner_thread_id_;
@@ -2088,8 +2107,8 @@ class MutexBase {
// particular, the owner_ field (a pthread_t) is not explicitly initialized.
// This allows initialization to work whether pthread_t is a scalar or struct.
// The flag -Wmissing-field-initializers must not be specified for this to work.
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
+#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+ ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}
// The Mutex class can only be used for mutexes created at runtime. It
// shares its API with MutexBase otherwise.
@@ -2479,7 +2498,7 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
// Functions deprecated by MSVC 8.0.
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
+GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
return strncpy(dest, src, n);
@@ -2527,7 +2546,7 @@ inline const char* GetEnv(const char* name) {
#endif
}
-GTEST_DISABLE_MSC_WARNINGS_POP_()
+GTEST_DISABLE_MSC_DEPRECATED_POP_()
#if GTEST_OS_WINDOWS_MOBILE
// Windows CE has no C library. The abort() function is used in
@@ -2665,7 +2684,7 @@ typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
// Parses 'str' for a 32-bit signed integer. If successful, writes the result
// to *value and returns true; otherwise leaves *value unchanged and returns
// false.
-// TODO(chandlerc): Find a better way to refactor flag and environment parsing
+// FIXME: Find a better way to refactor flag and environment parsing
// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
// function.
bool ParseInt32(const Message& src_text, const char* str, Int32* value);
diff --git a/googletest/include/gtest/internal/gtest-string.h b/googletest/include/gtest/internal/gtest-string.h
index 71eb840c..4c9b6262 100644
--- a/googletest/include/gtest/internal/gtest-string.h
+++ b/googletest/include/gtest/internal/gtest-string.h
@@ -27,17 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file declares the String class and functions used internally by
// Google Test. They are subject to change without notice. They should not used
// by code external to Google Test.
//
-// This header file is #included by
-// gtest/internal/gtest-internal.h.
+// This header file is #included by gtest-internal.h.
// It should not be #included by other files.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/googletest/include/gtest/internal/gtest-tuple.h b/googletest/include/gtest/internal/gtest-tuple.h
index e9b40534..78a3a6a0 100644
--- a/googletest/include/gtest/internal/gtest-tuple.h
+++ b/googletest/include/gtest/internal/gtest-tuple.h
@@ -30,11 +30,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
@@ -42,7 +43,7 @@
// The compiler used in Symbian has a bug that prevents us from declaring the
// tuple template as a friend (it complains that tuple is redefined). This
-// hack bypasses the bug by declaring the members that should otherwise be
+// bypasses the bug by declaring the members that should otherwise be
// private as public.
// Sun Studio versions < 12 also have the above bug.
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
diff --git a/googletest/include/gtest/internal/gtest-tuple.h.pump b/googletest/include/gtest/internal/gtest-tuple.h.pump
index 429ddfee..bb626e04 100644
--- a/googletest/include/gtest/internal/gtest-tuple.h.pump
+++ b/googletest/include/gtest/internal/gtest-tuple.h.pump
@@ -29,11 +29,12 @@ $$ This meta comment fixes auto-indentation in Emacs. }}
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
@@ -41,7 +42,7 @@ $$ This meta comment fixes auto-indentation in Emacs. }}
// The compiler used in Symbian has a bug that prevents us from declaring the
// tuple template as a friend (it complains that tuple is redefined). This
-// hack bypasses the bug by declaring the members that should otherwise be
+// bypasses the bug by declaring the members that should otherwise be
// private as public.
// Sun Studio versions < 12 also have the above bug.
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
diff --git a/googletest/include/gtest/internal/gtest-type-util.h b/googletest/include/gtest/internal/gtest-type-util.h
index 282b81fb..28e41124 100644
--- a/googletest/include/gtest/internal/gtest-type-util.h
+++ b/googletest/include/gtest/internal/gtest-type-util.h
@@ -30,8 +30,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Type utilities needed for implementing typed and type-parameterized
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
@@ -41,6 +40,8 @@
// Please contact googletestframework@googlegroups.com if you need
// more.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/googletest/include/gtest/internal/gtest-type-util.h.pump b/googletest/include/gtest/internal/gtest-type-util.h.pump
index eaa88801..0001a5d3 100644
--- a/googletest/include/gtest/internal/gtest-type-util.h.pump
+++ b/googletest/include/gtest/internal/gtest-type-util.h.pump
@@ -28,8 +28,7 @@ $var n = 50 $$ Maximum length of type lists we want to support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Type utilities needed for implementing typed and type-parameterized
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
@@ -39,6 +38,8 @@ $var n = 50 $$ Maximum length of type lists we want to support.
// Please contact googletestframework@googlegroups.com if you need
// more.
+// GOOGLETEST_CM0001 DO NOT DELETE
+
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/googletest/samples/prime_tables.h b/googletest/samples/prime_tables.h
index 55a3b44e..523c50b9 100644
--- a/googletest/samples/prime_tables.h
+++ b/googletest/samples/prime_tables.h
@@ -26,9 +26,8 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-// Author: vladl@google.com (Vlad Losev)
+
+
// This provides interface PrimeTable that determines whether a number is a
// prime and determines a next prime number. This interface is used
diff --git a/googletest/samples/sample1.cc b/googletest/samples/sample1.cc
index 7c08b28f..13cec1d0 100644
--- a/googletest/samples/sample1.cc
+++ b/googletest/samples/sample1.cc
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "sample1.h"
diff --git a/googletest/samples/sample1.h b/googletest/samples/sample1.h
index 3dfeb98c..2c3e9f05 100644
--- a/googletest/samples/sample1.h
+++ b/googletest/samples/sample1.h
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE1_H_
#define GTEST_SAMPLES_SAMPLE1_H_
diff --git a/googletest/samples/sample10_unittest.cc b/googletest/samples/sample10_unittest.cc
index 10aa7620..7ce9550f 100644
--- a/googletest/samples/sample10_unittest.cc
+++ b/googletest/samples/sample10_unittest.cc
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// This sample shows how to use Google Test listener API to implement
// a primitive leak checker.
diff --git a/googletest/samples/sample1_unittest.cc b/googletest/samples/sample1_unittest.cc
index 8376bb43..cb08b61a 100644
--- a/googletest/samples/sample1_unittest.cc
+++ b/googletest/samples/sample1_unittest.cc
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
// This sample shows how to write a simple unit test for a function,
// using Google C++ testing framework.
diff --git a/googletest/samples/sample2.cc b/googletest/samples/sample2.cc
index 5f763b9b..f3b722fc 100644
--- a/googletest/samples/sample2.cc
+++ b/googletest/samples/sample2.cc
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "sample2.h"
diff --git a/googletest/samples/sample2.h b/googletest/samples/sample2.h
index cb485c70..58f360f4 100644
--- a/googletest/samples/sample2.h
+++ b/googletest/samples/sample2.h
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE2_H_
#define GTEST_SAMPLES_SAMPLE2_H_
diff --git a/googletest/samples/sample2_unittest.cc b/googletest/samples/sample2_unittest.cc
index df522da5..08488261 100644
--- a/googletest/samples/sample2_unittest.cc
+++ b/googletest/samples/sample2_unittest.cc
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
// This sample shows how to write a more complex unit test for a class
// that has multiple member functions.
diff --git a/googletest/samples/sample3-inl.h b/googletest/samples/sample3-inl.h
index 7e3084d6..1a29ce92 100644
--- a/googletest/samples/sample3-inl.h
+++ b/googletest/samples/sample3-inl.h
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
#define GTEST_SAMPLES_SAMPLE3_INL_H_
diff --git a/googletest/samples/sample3_unittest.cc b/googletest/samples/sample3_unittest.cc
index 7f51fd89..e093c258 100644
--- a/googletest/samples/sample3_unittest.cc
+++ b/googletest/samples/sample3_unittest.cc
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
// In this example, we use a more advanced feature of Google Test called
// test fixture.
diff --git a/googletest/samples/sample4.cc b/googletest/samples/sample4.cc
index ae44bda6..b0ee6093 100644
--- a/googletest/samples/sample4.cc
+++ b/googletest/samples/sample4.cc
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include <stdio.h>
@@ -40,6 +38,16 @@ int Counter::Increment() {
return counter_++;
}
+// Returns the current counter value, and decrements it.
+// counter can not be less than 0, return 0 in this case
+int Counter::Decrement() {
+ if (counter_ == 0) {
+ return counter_;
+ } else {
+ return counter_--;
+ }
+}
+
// Prints the current counter value to STDOUT.
void Counter::Print() const {
printf("%d", counter_);
diff --git a/googletest/samples/sample4.h b/googletest/samples/sample4.h
index cd60f0dd..e256f406 100644
--- a/googletest/samples/sample4.h
+++ b/googletest/samples/sample4.h
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
#ifndef GTEST_SAMPLES_SAMPLE4_H_
#define GTEST_SAMPLES_SAMPLE4_H_
@@ -46,6 +43,9 @@ class Counter {
// Returns the current counter value, and increments it.
int Increment();
+ // Returns the current counter value, and decrements it.
+ int Decrement();
+
// Prints the current counter value to STDOUT.
void Print() const;
};
diff --git a/googletest/samples/sample4_unittest.cc b/googletest/samples/sample4_unittest.cc
index 7bf9ea34..d5144c0d 100644
--- a/googletest/samples/sample4_unittest.cc
+++ b/googletest/samples/sample4_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "sample4.h"
#include "gtest/gtest.h"
@@ -38,12 +37,17 @@ namespace {
TEST(Counter, Increment) {
Counter c;
+ // Test that counter 0 returns 0
+ EXPECT_EQ(0, c.Decrement());
+
// EXPECT_EQ() evaluates its arguments exactly once, so they
// can have side effects.
EXPECT_EQ(0, c.Increment());
EXPECT_EQ(1, c.Increment());
EXPECT_EQ(2, c.Increment());
+
+ EXPECT_EQ(3, c.Decrement());
}
} // namespace
diff --git a/googletest/samples/sample5_unittest.cc b/googletest/samples/sample5_unittest.cc
index 401a58a5..d8a8788c 100644
--- a/googletest/samples/sample5_unittest.cc
+++ b/googletest/samples/sample5_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// This sample teaches how to reuse a test fixture in multiple test
// cases by deriving sub-fixtures from it.
diff --git a/googletest/samples/sample6_unittest.cc b/googletest/samples/sample6_unittest.cc
index 1faf0c3d..ddf2f1c1 100644
--- a/googletest/samples/sample6_unittest.cc
+++ b/googletest/samples/sample6_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// This sample shows how to test common properties of multiple
// implementations of the same interface (aka interface tests).
diff --git a/googletest/samples/sample7_unittest.cc b/googletest/samples/sample7_unittest.cc
index efa97289..c1ae8bde 100644
--- a/googletest/samples/sample7_unittest.cc
+++ b/googletest/samples/sample7_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// This sample shows how to test common properties of multiple
// implementations of an interface (aka interface tests) using
diff --git a/googletest/samples/sample8_unittest.cc b/googletest/samples/sample8_unittest.cc
index b0ff2d1f..ce75cf03 100644
--- a/googletest/samples/sample8_unittest.cc
+++ b/googletest/samples/sample8_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// This sample shows how to test code relying on some global flag variables.
// Combine() helps with generating all possible combinations of such flags,
diff --git a/googletest/samples/sample9_unittest.cc b/googletest/samples/sample9_unittest.cc
index 75584bb0..53f9af5b 100644
--- a/googletest/samples/sample9_unittest.cc
+++ b/googletest/samples/sample9_unittest.cc
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
// This sample shows how to use Google Test listener API to implement
// an alternative console output and how to use the UnitTest reflection API
diff --git a/googletest/scripts/upload.py b/googletest/scripts/upload.py
index 81e8e04d..c852e4c9 100755
--- a/googletest/scripts/upload.py
+++ b/googletest/scripts/upload.py
@@ -242,7 +242,7 @@ class AbstractRpcServer(object):
The authentication process works as follows:
1) We get a username and password from the user
2) We use ClientLogin to obtain an AUTH token for the user
- (see http://code.google.com/apis/accounts/AuthForInstalledApps.html).
+ (see https://developers.google.com/identity/protocols/AuthForInstalledApps).
3) We pass the auth token to /_ah/login on the server to obtain an
authentication cookie. If login was successful, it tries to redirect
us to the URL we provided.
@@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
(content_type, body) ready for httplib.HTTP instance.
Source:
- http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
+ https://web.archive.org/web/20160116052001/code.activestate.com/recipes/146306
"""
BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
CRLF = '\r\n'
@@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
# svn cat translates keywords but svn diff doesn't. As a result of this
# behavior patching.PatchChunks() fails with a chunk mismatch error.
# This part was originally written by the Review Board development team
- # who had the same problem (http://reviews.review-board.org/r/276/).
+ # who had the same problem (https://reviews.reviewboard.org/r/276/).
# Mapping of keywords to known aliases
svn_keywords = {
# Standard keywords
@@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
status_lines = status.splitlines()
# If file is in a cl, the output will begin with
# "\n--- Changelist 'cl_name':\n". See
- # http://svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
+ # https://web.archive.org/web/20090918234815/svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
if (len(status_lines) == 3 and
not status_lines[0] and
status_lines[1].startswith("--- Changelist")):
diff --git a/googletest/src/gtest-all.cc b/googletest/src/gtest-all.cc
index 5872a2e6..b217a180 100644
--- a/googletest/src/gtest-all.cc
+++ b/googletest/src/gtest-all.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
+
//
// Google C++ Testing and Mocking Framework (Google Test)
//
diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc
index 2f772f6f..09083551 100644
--- a/googletest/src/gtest-death-test.cc
+++ b/googletest/src/gtest-death-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
+
//
// This file implements death tests.
@@ -67,6 +66,7 @@
# include <lib/fdio/spawn.h>
# include <zircon/processargs.h>
# include <zircon/syscalls.h>
+# include <zircon/syscalls/port.h>
# endif // GTEST_OS_FUCHSIA
#endif // GTEST_HAS_DEATH_TEST
@@ -232,10 +232,16 @@ static std::string DeathTestThreadWarning(size_t thread_count) {
Message msg;
msg << "Death tests use fork(), which is unsafe particularly"
<< " in a threaded context. For this test, " << GTEST_NAME_ << " ";
- if (thread_count == 0)
+ if (thread_count == 0) {
msg << "couldn't detect the number of threads.";
- else
+ } else {
msg << "detected " << thread_count << " threads.";
+ }
+ msg << " See "
+ "https://github.com/google/googletest/blob/master/googletest/docs/"
+ "advanced.md#death-tests-and-threads"
+ << " for more explanation and suggested solutions, especially if"
+ << " this is the last message you see before your test times out.";
return msg.GetString();
}
# endif // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
@@ -260,7 +266,7 @@ static const int kFuchsiaReadPipeFd = 3;
// statement, which is not allowed; THREW means that the test statement
// returned control by throwing an exception. IN_PROGRESS means the test
// has not yet concluded.
-// TODO(vladl@google.com): Unify names and possibly values for
+// FIXME: Unify names and possibly values for
// AbortReason, DeathTestOutcome, and flag characters above.
enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
@@ -575,7 +581,6 @@ bool DeathTestImpl::Passed(bool status_ok) {
if (status_ok) {
# if GTEST_USES_PCRE
// PCRE regexes support embedded NULs.
- // GTEST_USES_PCRE is defined only in google3 mode
const bool matched = RE::PartialMatch(error_message, *regex());
# else
const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
@@ -805,6 +810,12 @@ class FuchsiaDeathTest : public DeathTestImpl {
const char* file,
int line)
: DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
+ virtual ~FuchsiaDeathTest() {
+ zx_status_t status = zx_handle_close(child_process_);
+ GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
+ status = zx_handle_close(port_);
+ GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
+ }
// All of these virtual functions are inherited from DeathTest.
virtual int Wait();
@@ -816,7 +827,8 @@ class FuchsiaDeathTest : public DeathTestImpl {
// The line number on which the death test is located.
const int line_;
- zx_handle_t child_process_;
+ zx_handle_t child_process_ = ZX_HANDLE_INVALID;
+ zx_handle_t port_ = ZX_HANDLE_INVALID;
};
// Utility class for accumulating command-line arguments.
@@ -863,16 +875,38 @@ int FuchsiaDeathTest::Wait() {
if (!spawned())
return 0;
- // Wait for child process to terminate.
+ // Register to wait for the child process to terminate.
zx_status_t status_zx;
- zx_signals_t signals;
- status_zx = zx_object_wait_one(
- child_process_,
- ZX_PROCESS_TERMINATED,
- ZX_TIME_INFINITE,
- &signals);
+ status_zx = zx_object_wait_async(child_process_,
+ port_,
+ 0 /* key */,
+ ZX_PROCESS_TERMINATED,
+ ZX_WAIT_ASYNC_ONCE);
+ GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
+
+ // Wait for it to terminate, or an exception to be received.
+ zx_port_packet_t packet;
+ status_zx = zx_port_wait(port_, ZX_TIME_INFINITE, &packet);
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
+ if (ZX_PKT_IS_EXCEPTION(packet.type)) {
+ // Process encountered an exception. Kill it directly rather than letting
+ // other handlers process the event.
+ status_zx = zx_task_kill(child_process_);
+ GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
+
+ // Now wait for |child_process_| to terminate.
+ zx_signals_t signals = 0;
+ status_zx = zx_object_wait_one(
+ child_process_, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, &signals);
+ GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
+ GTEST_DEATH_TEST_CHECK_(signals & ZX_PROCESS_TERMINATED);
+ } else {
+ // Process terminated.
+ GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
+ GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_PROCESS_TERMINATED);
+ }
+
ReadAndInterpretStatusByte();
zx_info_process_t buffer;
@@ -936,13 +970,10 @@ DeathTest::TestRole FuchsiaDeathTest::AssumeRole() {
set_read_fd(status);
// Set the pipe handle for the child.
- fdio_spawn_action_t add_handle_action = {
- .action = FDIO_SPAWN_ACTION_ADD_HANDLE,
- .h = {
- .id = PA_HND(type, kFuchsiaReadPipeFd),
- .handle = child_pipe_handle
- }
- };
+ fdio_spawn_action_t add_handle_action = {};
+ add_handle_action.action = FDIO_SPAWN_ACTION_ADD_HANDLE;
+ add_handle_action.h.id = PA_HND(type, kFuchsiaReadPipeFd);
+ add_handle_action.h.handle = child_pipe_handle;
// Spawn the child process.
status = fdio_spawn_etc(ZX_HANDLE_INVALID, FDIO_SPAWN_CLONE_ALL,
@@ -950,6 +981,14 @@ DeathTest::TestRole FuchsiaDeathTest::AssumeRole() {
&add_handle_action, &child_process_, nullptr);
GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
+ // Create an exception port and attach it to the |child_process_|, to allow
+ // us to suppress the system default exception handler from firing.
+ status = zx_port_create(0, &port_);
+ GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
+ status = zx_task_bind_exception_port(
+ child_process_, port_, 0 /* key */, 0 /*options */);
+ GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
+
set_spawned(true);
return OVERSEE_TEST;
}
@@ -1419,7 +1458,7 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
StreamableToString(parent_process_id));
}
- // TODO(vladl@google.com): Replace the following check with a
+ // FIXME: Replace the following check with a
// compile-time assertion when available.
GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc
index 6b76ea0f..a7e65c08 100644
--- a/googletest/src/gtest-filepath.cc
+++ b/googletest/src/gtest-filepath.cc
@@ -250,7 +250,7 @@ bool FilePath::DirectoryExists() const {
// root directory per disk drive.)
bool FilePath::IsRootDirectory() const {
#if GTEST_OS_WINDOWS
- // TODO(wan@google.com): on Windows a network share like
+ // FIXME: on Windows a network share like
// \\server\share can be a root directory, although it cannot be the
// current directory. Handle this properly.
return pathname_.length() == 3 && IsAbsolutePath();
@@ -350,7 +350,7 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
// Removes any redundant separators that might be in the pathname.
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
// redundancies that might be in a pathname involving "." or "..".
-// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
+// FIXME: handle Windows network shares (e.g. \\server\share).
void FilePath::Normalize() {
if (pathname_.c_str() == NULL) {
pathname_ = "";
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h
index c5a42650..47900414 100644
--- a/googletest/src/gtest-internal-inl.h
+++ b/googletest/src/gtest-internal-inl.h
@@ -27,10 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Utility functions and classes used by the Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
+// Utility functions and classes used by the Google C++ testing framework.//
// This file contains purely Google Test's internal implementation. Please
// DO NOT #INCLUDE IT IN A USER PROGRAM.
@@ -62,6 +59,9 @@
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
+/* class A needs to have dll-interface to be used by clients of class B */)
+
namespace testing {
// Declares the flags.
@@ -994,7 +994,7 @@ bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
const bool parse_success = *end == '\0' && errno == 0;
- // TODO(vladl@google.com): Convert this to compile time assertion when it is
+ // FIXME: Convert this to compile time assertion when it is
// available.
GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
@@ -1182,4 +1182,6 @@ class StreamingListener : public EmptyTestEventListener {
} // namespace internal
} // namespace testing
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
+
#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index 2c892ecc..85bdbfd8 100644
--- a/googletest/src/gtest-port.cc
+++ b/googletest/src/gtest-port.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/internal/gtest-port.h"
@@ -262,9 +261,9 @@ Mutex::Mutex()
Mutex::~Mutex() {
// Static mutexes are leaked intentionally. It is not thread-safe to try
// to clean them up.
- // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
+ // FIXME: Switch to Slim Reader/Writer (SRW) Locks, which requires
// nothing to clean it up but is available only on Vista and later.
- // http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
+ // https://docs.microsoft.com/en-us/windows/desktop/Sync/slim-reader-writer--srw--locks
if (type_ == kDynamic) {
::DeleteCriticalSection(critical_section_);
delete critical_section_;
@@ -295,6 +294,43 @@ void Mutex::AssertHeld() {
<< "The current thread is not holding the mutex @" << this;
}
+namespace {
+
+// Use the RAII idiom to flag mem allocs that are intentionally never
+// deallocated. The motivation is to silence the false positive mem leaks
+// that are reported by the debug version of MS's CRT which can only detect
+// if an alloc is missing a matching deallocation.
+// Example:
+// MemoryIsNotDeallocated memory_is_not_deallocated;
+// critical_section_ = new CRITICAL_SECTION;
+//
+class MemoryIsNotDeallocated
+{
+ public:
+ MemoryIsNotDeallocated() : old_crtdbg_flag_(0) {
+#ifdef _MSC_VER
+ old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
+ // Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT
+ // doesn't report mem leak if there's no matching deallocation.
+ _CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);
+#endif // _MSC_VER
+ }
+
+ ~MemoryIsNotDeallocated() {
+#ifdef _MSC_VER
+ // Restore the original _CRTDBG_ALLOC_MEM_DF flag
+ _CrtSetDbgFlag(old_crtdbg_flag_);
+#endif // _MSC_VER
+ }
+
+ private:
+ int old_crtdbg_flag_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MemoryIsNotDeallocated);
+};
+
+} // namespace
+
// Initializes owner_thread_id_ and critical_section_ in static mutexes.
void Mutex::ThreadSafeLazyInit() {
// Dynamic mutexes are initialized in the constructor.
@@ -305,7 +341,11 @@ void Mutex::ThreadSafeLazyInit() {
// If critical_section_init_phase_ was 0 before the exchange, we
// are the first to test it and need to perform the initialization.
owner_thread_id_ = 0;
- critical_section_ = new CRITICAL_SECTION;
+ {
+ // Use RAII to flag that following mem alloc is never deallocated.
+ MemoryIsNotDeallocated memory_is_not_deallocated;
+ critical_section_ = new CRITICAL_SECTION;
+ }
::InitializeCriticalSection(critical_section_);
// Updates the critical_section_init_phase_ to 2 to signal
// initialization complete.
@@ -344,7 +384,7 @@ class ThreadWithParamSupport : public ThreadWithParamBase {
Notification* thread_can_start) {
ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
DWORD thread_id;
- // TODO(yukawa): Consider to use _beginthreadex instead.
+ // FIXME: Consider to use _beginthreadex instead.
HANDLE thread_handle = ::CreateThread(
NULL, // Default security.
0, // Default stack size.
@@ -547,7 +587,8 @@ class ThreadLocalRegistryImpl {
// Returns map of thread local instances.
static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
mutex_.AssertHeld();
- static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
+ MemoryIsNotDeallocated memory_is_not_deallocated;
+ static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals();
return map;
}
@@ -696,7 +737,7 @@ static std::string FormatRegexSyntaxError(const char* regex, int index) {
// otherwise returns true.
bool ValidateRegex(const char* regex) {
if (regex == NULL) {
- // TODO(wan@google.com): fix the source file location in the
+ // FIXME: fix the source file location in the
// assertion failures to match where the regex is used in user
// code.
ADD_FAILURE() << "NULL is not a valid simple regular expression.";
@@ -942,7 +983,7 @@ GTestLog::~GTestLog() {
// Disable Microsoft deprecation warnings for POSIX functions called from
// this class (creat, dup, dup2, and close)
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
#if GTEST_HAS_STREAM_REDIRECTION
@@ -1012,7 +1053,7 @@ class CapturedStream {
GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
};
-GTEST_DISABLE_MSC_WARNINGS_POP_()
+GTEST_DISABLE_MSC_DEPRECATED_POP_()
static CapturedStream* g_captured_stderr = NULL;
static CapturedStream* g_captured_stdout = NULL;
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc
index eeba17fb..de4d245e 100644
--- a/googletest/src/gtest-printers.cc
+++ b/googletest/src/gtest-printers.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Test - The Google C++ Testing and Mocking Framework
//
@@ -90,7 +89,7 @@ void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
// If the object size is bigger than kThreshold, we'll have to omit
// some details by printing only the first and the last kChunkSize
// bytes.
- // TODO(wan): let the user control the threshold using a flag.
+ // FIXME: let the user control the threshold using a flag.
if (count < kThreshold) {
PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
} else {
diff --git a/googletest/src/gtest-test-part.cc b/googletest/src/gtest-test-part.cc
index 4c5f2e37..c88860d9 100644
--- a/googletest/src/gtest-test-part.cc
+++ b/googletest/src/gtest-test-part.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
diff --git a/googletest/src/gtest-typed-test.cc b/googletest/src/gtest-typed-test.cc
index b3582434..1dc2ad38 100644
--- a/googletest/src/gtest-typed-test.cc
+++ b/googletest/src/gtest-typed-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/gtest-typed-test.h"
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 9c25c997..96b07c68 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
@@ -55,7 +54,7 @@
#if GTEST_OS_LINUX
-// TODO(kenton@google.com): Use autoconf to detect availability of
+// FIXME: Use autoconf to detect availability of
// gettimeofday().
# define GTEST_HAS_GETTIMEOFDAY_ 1
@@ -94,9 +93,9 @@
# if GTEST_OS_WINDOWS_MINGW
// MinGW has gettimeofday() but not _ftime64().
-// TODO(kenton@google.com): Use autoconf to detect availability of
+// FIXME: Use autoconf to detect availability of
// gettimeofday().
-// TODO(kenton@google.com): There are other ways to get the time on
+// FIXME: There are other ways to get the time on
// Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW
// supports these. consider using them instead.
# define GTEST_HAS_GETTIMEOFDAY_ 1
@@ -111,7 +110,7 @@
#else
// Assume other platforms have gettimeofday().
-// TODO(kenton@google.com): Use autoconf to detect availability of
+// FIXME: Use autoconf to detect availability of
// gettimeofday().
# define GTEST_HAS_GETTIMEOFDAY_ 1
@@ -139,6 +138,12 @@
# define vsnprintf _vsnprintf
#endif // GTEST_OS_WINDOWS
+#if GTEST_OS_MAC
+#ifndef GTEST_OS_IOS
+#include <crt_externs.h>
+#endif
+#endif
+
#if GTEST_HAS_ABSL
#include "absl/debugging/failure_signal_handler.h"
#include "absl/debugging/stacktrace.h"
@@ -189,6 +194,21 @@ const char kStackTraceMarker[] = "\nStack trace:\n";
// specified on the command line.
bool g_help_flag = false;
+// Utilty function to Open File for Writing
+static FILE* OpenFileForWriting(const std::string& output_file) {
+ FILE* fileout = NULL;
+ FilePath output_file_path(output_file);
+ FilePath output_dir(output_file_path.RemoveFileName());
+
+ if (output_dir.CreateDirectoriesRecursively()) {
+ fileout = posix::FOpen(output_file.c_str(), "w");
+ }
+ if (fileout == NULL) {
+ GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
+ }
+ return fileout;
+}
+
} // namespace internal
// Bazel passes in the argument to '--test_filter' via the TESTBRIDGE_TEST_ONLY
@@ -407,7 +427,7 @@ void AssertHelper::operator=(const Message& message) const {
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
// A copy of all command line arguments. Set by InitGoogleTest().
-::std::vector<std::string> g_argvs;
+static ::std::vector<std::string> g_argvs;
::std::vector<std::string> GetArgvs() {
#if defined(GTEST_CUSTOM_GET_ARGVS_)
@@ -439,8 +459,6 @@ FilePath GetCurrentExecutableName() {
// Returns the output format, or "" for normal printed output.
std::string UnitTestOptions::GetOutputFormat() {
const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL) return std::string("");
-
const char* const colon = strchr(gtest_output_flag, ':');
return (colon == NULL) ?
std::string(gtest_output_flag) :
@@ -451,8 +469,6 @@ std::string UnitTestOptions::GetOutputFormat() {
// was explicitly specified.
std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL)
- return "";
std::string format = GetOutputFormat();
if (format.empty())
@@ -468,7 +484,7 @@ std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
internal::FilePath output_name(colon + 1);
if (!output_name.IsAbsolutePath())
- // TODO(wan@google.com): on Windows \some\path is not an absolute
+ // FIXME: on Windows \some\path is not an absolute
// path (as its meaning depends on the current drive), yet the
// following logic for turning it into an absolute path is wrong.
// Fix it.
@@ -842,7 +858,7 @@ TimeInMillis GetTimeInMillis() {
SYSTEMTIME now_systime;
FILETIME now_filetime;
ULARGE_INTEGER now_int64;
- // TODO(kenton@google.com): Shouldn't this just use
+ // FIXME: Shouldn't this just use
// GetSystemTimeAsFileTime()?
GetSystemTime(&now_systime);
if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
@@ -858,11 +874,11 @@ TimeInMillis GetTimeInMillis() {
// MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
// (deprecated function) there.
- // TODO(kenton@google.com): Use GetTickCount()? Or use
+ // FIXME: Use GetTickCount()? Or use
// SystemTimeToFileTime()
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+ GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
_ftime64(&now);
- GTEST_DISABLE_MSC_WARNINGS_POP_()
+ GTEST_DISABLE_MSC_DEPRECATED_POP_()
return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
#elif GTEST_HAS_GETTIMEOFDAY_
@@ -1397,7 +1413,7 @@ AssertionResult DoubleNearPredFormat(const char* expr1,
const double diff = fabs(val1 - val2);
if (diff <= abs_error) return AssertionSuccess();
- // TODO(wan): do not print the value of an expression if it's
+ // FIXME: do not print the value of an expression if it's
// already a literal.
return AssertionFailure()
<< "The difference between " << expr1 << " and " << expr2
@@ -2125,13 +2141,8 @@ static const char* const kReservedTestSuiteAttributes[] = {
// The list of reserved attributes used in the <testcase> element of XML output.
static const char* const kReservedTestCaseAttributes[] = {
- "classname",
- "name",
- "status",
- "time",
- "type_param",
- "value_param"
-};
+ "classname", "name", "status", "time",
+ "type_param", "value_param", "file", "line"};
template <int kSize>
std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
@@ -2674,18 +2685,18 @@ void TestInfo::Run() {
factory_, &internal::TestFactoryBase::CreateTest,
"the test fixture's constructor");
- // Runs the test only if the test object was created and its
- // constructor didn't generate a fatal failure.
- if ((test != NULL) && !Test::HasFatalFailure()) {
+ // Runs the test if the constructor didn't generate a fatal failure.
+ // Note that the object will not be null
+ if (!Test::HasFatalFailure()) {
// This doesn't throw as all user code that can throw are wrapped into
// exception handling code.
test->Run();
}
- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
+ // Deletes the test object.
+ impl->os_stack_trace_getter()->UponLeavingGTest();
+ internal::HandleExceptionsInMethodIfSupported(
+ test, &Test::DeleteSelf_, "the test fixture's destructor");
result_.set_elapsed_time(internal::GetTimeInMillis() - start);
@@ -3138,6 +3149,7 @@ void PrettyUnitTestResultPrinter::OnTestIterationStart(
"Note: Randomizing tests' orders with a seed of %d .\n",
unit_test.random_seed());
}
+
ColoredPrintf(COLOR_GREEN, "[==========] ");
printf("Running %s from %s.\n",
FormatTestCount(unit_test.test_to_run_count()).c_str(),
@@ -3334,7 +3346,7 @@ void TestEventRepeater::Append(TestEventListener *listener) {
listeners_.push_back(listener);
}
-// TODO(vladl@google.com): Factor the search functionality into Vector::Find.
+// FIXME: Factor the search functionality into Vector::Find.
TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
for (size_t i = 0; i < listeners_.size(); ++i) {
if (listeners_[i] == listener) {
@@ -3408,6 +3420,11 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
explicit XmlUnitTestResultPrinter(const char* output_file);
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+ void ListTestsMatchingFilter(const std::vector<TestCase*>& test_cases);
+
+ // Prints an XML summary of all unit tests.
+ static void PrintXmlTestsList(std::ostream* stream,
+ const std::vector<TestCase*>& test_cases);
private:
// Is c a whitespace character that is normalized to a space character
@@ -3483,7 +3500,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
// Creates a new XmlUnitTestResultPrinter.
XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
: output_file_(output_file) {
- if (output_file_.c_str() == NULL || output_file_.empty()) {
+ if (output_file_.empty()) {
GTEST_LOG_(FATAL) << "XML output file may not be null";
}
}
@@ -3491,33 +3508,22 @@ XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
// Called after the unit test ends.
void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
int /*iteration*/) {
- FILE* xmlout = NULL;
- FilePath output_file(output_file_);
- FilePath output_dir(output_file.RemoveFileName());
-
- if (output_dir.CreateDirectoriesRecursively()) {
- xmlout = posix::FOpen(output_file_.c_str(), "w");
- }
- if (xmlout == NULL) {
- // TODO(wan): report the reason of the failure.
- //
- // We don't do it for now as:
- //
- // 1. There is no urgent need for it.
- // 2. It's a bit involved to make the errno variable thread-safe on
- // all three operating systems (Linux, Windows, and Mac OS).
- // 3. To interpret the meaning of errno in a thread-safe way,
- // we need the strerror_r() function, which is not available on
- // Windows.
-
- GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file_ << "\"";
- }
+ FILE* xmlout = OpenFileForWriting(output_file_);
std::stringstream stream;
PrintXmlUnitTest(&stream, unit_test);
fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
fclose(xmlout);
}
+void XmlUnitTestResultPrinter::ListTestsMatchingFilter(
+ const std::vector<TestCase*>& test_cases) {
+ FILE* xmlout = OpenFileForWriting(output_file_);
+ std::stringstream stream;
+ PrintXmlTestsList(&stream, test_cases);
+ fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
+ fclose(xmlout);
+}
+
// Returns an XML-escaped copy of the input string str. If is_attribute
// is true, the text is meant to appear as an attribute value, and
// normalizable whitespace is preserved by replacing it with character
@@ -3528,7 +3534,7 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// module will consist of ordinary English text.
// If this module is ever modified to produce version 1.1 XML output,
// most invalid characters can be retained using character references.
-// TODO(wan): It might be nice to have a minimally invasive, human-readable
+// FIXME: It might be nice to have a minimally invasive, human-readable
// escaping scheme for invalid characters, rather than dropping them.
std::string XmlUnitTestResultPrinter::EscapeXml(
const std::string& str, bool is_attribute) {
@@ -3589,6 +3595,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
// The following routines generate an XML representation of a UnitTest
// object.
+// GOOGLETEST_CM0009 DO NOT DELETE
//
// This is how Google Test concepts map to the DTD:
//
@@ -3678,7 +3685,7 @@ void XmlUnitTestResultPrinter::OutputXmlAttribute(
}
// Prints an XML representation of a TestInfo object.
-// TODO(wan): There is also value in printing properties with the plain printer.
+// FIXME: There is also value in printing properties with the plain printer.
void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
const char* test_case_name,
const TestInfo& test_info) {
@@ -3699,6 +3706,13 @@ void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
if (test_info.type_param() != NULL) {
OutputXmlAttribute(stream, kTestcase, "type_param", test_info.type_param());
}
+ if (GTEST_FLAG(list_tests)) {
+ OutputXmlAttribute(stream, kTestcase, "file", test_info.file());
+ OutputXmlAttribute(stream, kTestcase, "line",
+ StreamableToString(test_info.line()));
+ *stream << " />\n";
+ return;
+ }
OutputXmlAttribute(stream, kTestcase, "status",
test_info.should_run() ? "run" : "notrun");
@@ -3745,17 +3759,18 @@ void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,
OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());
OutputXmlAttribute(stream, kTestsuite, "tests",
StreamableToString(test_case.reportable_test_count()));
- OutputXmlAttribute(stream, kTestsuite, "failures",
- StreamableToString(test_case.failed_test_count()));
- OutputXmlAttribute(
- stream, kTestsuite, "disabled",
- StreamableToString(test_case.reportable_disabled_test_count()));
- OutputXmlAttribute(stream, kTestsuite, "errors", "0");
- OutputXmlAttribute(stream, kTestsuite, "time",
- FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
- *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result())
- << ">\n";
-
+ if (!GTEST_FLAG(list_tests)) {
+ OutputXmlAttribute(stream, kTestsuite, "failures",
+ StreamableToString(test_case.failed_test_count()));
+ OutputXmlAttribute(
+ stream, kTestsuite, "disabled",
+ StreamableToString(test_case.reportable_disabled_test_count()));
+ OutputXmlAttribute(stream, kTestsuite, "errors", "0");
+ OutputXmlAttribute(stream, kTestsuite, "time",
+ FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
+ *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result());
+ }
+ *stream << ">\n";
for (int i = 0; i < test_case.total_test_count(); ++i) {
if (test_case.GetTestInfo(i)->is_reportable())
OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
@@ -3801,6 +3816,28 @@ void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,
*stream << "</" << kTestsuites << ">\n";
}
+void XmlUnitTestResultPrinter::PrintXmlTestsList(
+ std::ostream* stream, const std::vector<TestCase*>& test_cases) {
+ const std::string kTestsuites = "testsuites";
+
+ *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ *stream << "<" << kTestsuites;
+
+ int total_tests = 0;
+ for (size_t i = 0; i < test_cases.size(); ++i) {
+ total_tests += test_cases[i]->total_test_count();
+ }
+ OutputXmlAttribute(stream, kTestsuites, "tests",
+ StreamableToString(total_tests));
+ OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
+ *stream << ">\n";
+
+ for (size_t i = 0; i < test_cases.size(); ++i) {
+ PrintXmlTestCase(stream, *test_cases[i]);
+ }
+ *stream << "</" << kTestsuites << ">\n";
+}
+
// Produces a string representing the test properties in a result as space
// delimited XML attributes based on the property key="value" pairs.
std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
@@ -3836,7 +3873,6 @@ void XmlUnitTestResultPrinter::OutputXmlTestProperties(
// End XmlUnitTestResultPrinter
-
// This class generates an JSON output file.
class JsonUnitTestResultPrinter : public EmptyTestEventListener {
public:
@@ -3844,6 +3880,10 @@ class JsonUnitTestResultPrinter : public EmptyTestEventListener {
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+ // Prints an JSON summary of all unit tests.
+ static void PrintJsonTestList(::std::ostream* stream,
+ const std::vector<TestCase*>& test_cases);
+
private:
// Returns an JSON-escaped copy of the input string str.
static std::string EscapeJson(const std::string& str);
@@ -3897,27 +3937,7 @@ JsonUnitTestResultPrinter::JsonUnitTestResultPrinter(const char* output_file)
void JsonUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
int /*iteration*/) {
- FILE* jsonout = NULL;
- FilePath output_file(output_file_);
- FilePath output_dir(output_file.RemoveFileName());
-
- if (output_dir.CreateDirectoriesRecursively()) {
- jsonout = posix::FOpen(output_file_.c_str(), "w");
- }
- if (jsonout == NULL) {
- // TODO(phosek): report the reason of the failure.
- //
- // We don't do it for now as:
- //
- // 1. There is no urgent need for it.
- // 2. It's a bit involved to make the errno variable thread-safe on
- // all three operating systems (Linux, Windows, and Mac OS).
- // 3. To interpret the meaning of errno in a thread-safe way,
- // we need the strerror_r() function, which is not available on
- // Windows.
- GTEST_LOG_(FATAL) << "Unable to open file \""
- << output_file_ << "\"";
- }
+ FILE* jsonout = OpenFileForWriting(output_file_);
std::stringstream stream;
PrintJsonUnitTest(&stream, unit_test);
fprintf(jsonout, "%s", StringStreamToString(&stream).c_str());
@@ -4052,6 +4072,12 @@ void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,
OutputJsonKey(stream, kTestcase, "type_param", test_info.type_param(),
kIndent);
}
+ if (GTEST_FLAG(list_tests)) {
+ OutputJsonKey(stream, kTestcase, "file", test_info.file(), kIndent);
+ OutputJsonKey(stream, kTestcase, "line", test_info.line(), kIndent, false);
+ *stream << "\n" << Indent(8) << "}";
+ return;
+ }
OutputJsonKey(stream, kTestcase, "status",
test_info.should_run() ? "RUN" : "NOTRUN", kIndent);
@@ -4094,16 +4120,18 @@ void JsonUnitTestResultPrinter::PrintJsonTestCase(std::ostream* stream,
OutputJsonKey(stream, kTestsuite, "name", test_case.name(), kIndent);
OutputJsonKey(stream, kTestsuite, "tests", test_case.reportable_test_count(),
kIndent);
- OutputJsonKey(stream, kTestsuite, "failures", test_case.failed_test_count(),
- kIndent);
- OutputJsonKey(stream, kTestsuite, "disabled",
- test_case.reportable_disabled_test_count(), kIndent);
- OutputJsonKey(stream, kTestsuite, "errors", 0, kIndent);
- OutputJsonKey(stream, kTestsuite, "time",
- FormatTimeInMillisAsDuration(test_case.elapsed_time()), kIndent,
- false);
- *stream << TestPropertiesAsJson(test_case.ad_hoc_test_result(), kIndent)
- << ",\n";
+ if (!GTEST_FLAG(list_tests)) {
+ OutputJsonKey(stream, kTestsuite, "failures", test_case.failed_test_count(),
+ kIndent);
+ OutputJsonKey(stream, kTestsuite, "disabled",
+ test_case.reportable_disabled_test_count(), kIndent);
+ OutputJsonKey(stream, kTestsuite, "errors", 0, kIndent);
+ OutputJsonKey(stream, kTestsuite, "time",
+ FormatTimeInMillisAsDuration(test_case.elapsed_time()),
+ kIndent, false);
+ *stream << TestPropertiesAsJson(test_case.ad_hoc_test_result(), kIndent)
+ << ",\n";
+ }
*stream << kIndent << "\"" << kTestsuite << "\": [\n";
@@ -4167,6 +4195,31 @@ void JsonUnitTestResultPrinter::PrintJsonUnitTest(std::ostream* stream,
*stream << "\n" << kIndent << "]\n" << "}\n";
}
+void JsonUnitTestResultPrinter::PrintJsonTestList(
+ std::ostream* stream, const std::vector<TestCase*>& test_cases) {
+ const std::string kTestsuites = "testsuites";
+ const std::string kIndent = Indent(2);
+ *stream << "{\n";
+ int total_tests = 0;
+ for (size_t i = 0; i < test_cases.size(); ++i) {
+ total_tests += test_cases[i]->total_test_count();
+ }
+ OutputJsonKey(stream, kTestsuites, "tests", total_tests, kIndent);
+
+ OutputJsonKey(stream, kTestsuites, "name", "AllTests", kIndent);
+ *stream << kIndent << "\"" << kTestsuites << "\": [\n";
+
+ for (size_t i = 0; i < test_cases.size(); ++i) {
+ if (i != 0) {
+ *stream << ",\n";
+ }
+ PrintJsonTestCase(stream, *test_cases[i]);
+ }
+
+ *stream << "\n"
+ << kIndent << "]\n"
+ << "}\n";
+}
// Produces a string representing the test properties in a result as
// a JSON dictionary.
std::string JsonUnitTestResultPrinter::TestPropertiesAsJson(
@@ -4691,7 +4744,7 @@ int UnitTest::Run() {
// used for the duration of the program.
impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));
-#if GTEST_HAS_SEH
+#if GTEST_OS_WINDOWS
// Either the user wants Google Test to catch exceptions thrown by the
// tests or this is executing in the context of death test child
// process. In either case the user does not want to see pop-up dialogs
@@ -4720,7 +4773,7 @@ int UnitTest::Run() {
// VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
// Users of prior VC versions shall suffer the agony and pain of
// clicking through the countless debug dialogs.
- // TODO(vladl@google.com): find a way to suppress the abort dialog() in the
+ // FIXME: find a way to suppress the abort dialog() in the
// debug mode when compiled with VC 7.1 or lower.
if (!GTEST_FLAG(break_on_failure))
_set_abort_behavior(
@@ -4728,7 +4781,7 @@ int UnitTest::Run() {
_WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump.
# endif
}
-#endif // GTEST_HAS_SEH
+#endif // GTEST_OS_WINDOWS
return internal::HandleExceptionsInMethodIfSupported(
impl(),
@@ -5387,6 +5440,23 @@ void UnitTestImpl::ListTestsMatchingFilter() {
}
}
fflush(stdout);
+ const std::string& output_format = UnitTestOptions::GetOutputFormat();
+ if (output_format == "xml" || output_format == "json") {
+ FILE* fileout = OpenFileForWriting(
+ UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
+ std::stringstream stream;
+ if (output_format == "xml") {
+ XmlUnitTestResultPrinter(
+ UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
+ .PrintXmlTestsList(&stream, test_cases_);
+ } else if (output_format == "json") {
+ JsonUnitTestResultPrinter(
+ UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
+ .PrintJsonTestList(&stream, test_cases_);
+ }
+ fprintf(fileout, "%s", StringStreamToString(&stream).c_str());
+ fclose(fileout);
+ }
}
// Sets the OS stack trace getter.
@@ -5614,7 +5684,7 @@ static bool HasGoogleTestFlagPrefix(const char* str) {
// @Y changes the color to yellow.
// @D changes to the default terminal text color.
//
-// TODO(wan@google.com): Write tests for this once we add stdout
+// FIXME: Write tests for this once we add stdout
// capturing to Google Test.
static void PrintColorEncoded(const char* str) {
GTestColor color = COLOR_DEFAULT; // The current color.
@@ -5824,6 +5894,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
// other parts of Google Test.
void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
ParseGoogleTestFlagsOnlyImpl(argc, argv);
+
+ // Fix the value of *_NSGetArgc() on macOS, but iff
+ // *_NSGetArgv() == argv
+ // Only applicable to char** version of argv
+#if GTEST_OS_MAC
+#ifndef GTEST_OS_IOS
+ if (*_NSGetArgv() == argv) {
+ *_NSGetArgc() = *argc;
+ }
+#endif
+#endif
}
void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
ParseGoogleTestFlagsOnlyImpl(argc, argv);
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index 5e9c94cb..2113f621 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -26,13 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
#include <stdio.h>
#include "gtest/gtest.h"
GTEST_API_ int main(int argc, char **argv) {
- printf("Running main() from gtest_main.cc\n");
+ printf("Running main() from %s\n", __FILE__);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel
index 405feee7..a930d65e 100644
--- a/googletest/test/BUILD.bazel
+++ b/googletest/test/BUILD.bazel
@@ -49,31 +49,48 @@ config_setting(
values = {"define": "absl=1"},
)
-#on windows exclude gtest-tuple.h and gtest-tuple_test.cc
+#on windows exclude gtest-tuple.h and googletest-tuple-test.cc
cc_test(
name = "gtest_all_test",
size = "small",
srcs = glob(
include = [
"gtest-*.cc",
+ "googletest-*.cc",
"*.h",
"googletest/include/gtest/**/*.h",
],
exclude = [
"gtest-unittest-api_test.cc",
- "gtest-tuple_test.cc",
+ "googletest-tuple-test.cc",
"googletest/src/gtest-all.cc",
"gtest_all_test.cc",
"gtest-death-test_ex_test.cc",
"gtest-listener_test.cc",
"gtest-unittest-api_test.cc",
- "gtest-param-test_test.cc",
+ "googletest-param-test-test.cc",
+ "googletest-catch-exceptions-test_.cc",
+ "googletest-color-test_.cc",
+ "googletest-env-var-test_.cc",
+ "googletest-filter-unittest_.cc",
+ "googletest-break-on-failure-unittest_.cc",
+ "googletest-listener-test.cc",
+ "googletest-output-test_.cc",
+ "googletest-list-tests-unittest_.cc",
+ "googletest-shuffle-test_.cc",
+ "googletest-uninitialized-test_.cc",
+ "googletest-death-test_ex_test.cc",
+ "googletest-param-test-test",
+ "googletest-throw-on-failure-test_.cc",
+ "googletest-param-test-invalid-name1-test_.cc",
+ "googletest-param-test-invalid-name2-test_.cc",
+
],
) + select({
"//:windows": [],
"//:windows_msvc": [],
"//conditions:default": [
- "gtest-tuple_test.cc",
+ "googletest-tuple-test.cc",
],
}),
copts = select({
@@ -97,16 +114,28 @@ cc_test(
deps = ["//:gtest_main"],
)
+
+# Tests death tests.
+cc_test(
+ name = "googletest-death-test-test",
+ size = "medium",
+ srcs = ["googletest-death-test-test.cc"],
+ deps = ["//:gtest_main"],
+)
+
+cc_test(
+ name = "gtest_test_macro_stack_footprint_test",
+ size = "small",
+ srcs = ["gtest_test_macro_stack_footprint_test.cc"],
+ deps = ["//:gtest"],
+)
+
#These googletest tests have their own main()
cc_test(
- name = "gtest-listener_test",
+ name = "googletest-listener-test",
size = "small",
- srcs = [
- "gtest-listener_test.cc",
- ],
- deps = [
- "//:gtest",
- ],
+ srcs = ["googletest-listener-test.cc"],
+ deps = ["//:gtest_main"],
)
cc_test(
@@ -121,16 +150,14 @@ cc_test(
)
cc_test(
- name = "gtest-param-test_test",
+ name = "googletest-param-test-test",
size = "small",
srcs = [
- "gtest-param-test2_test.cc",
- "gtest-param-test_test.cc",
- "gtest-param-test_test.h",
- ],
- deps = [
- "//:gtest",
+ "googletest-param-test-test.cc",
+ "googletest-param-test-test.h",
+ "googletest-param-test2-test.cc",
],
+ deps = ["//:gtest"],
)
cc_test(
@@ -166,87 +193,92 @@ py_test(
)
cc_binary(
- name = "gtest_output_test_",
+ name = "googletest-output-test_",
testonly = 1,
- srcs = ["gtest_output_test_.cc"],
+ srcs = ["googletest-output-test_.cc"],
deps = ["//:gtest"],
)
+
py_test(
- name = "gtest_output_test",
+ name = "googletest-output-test",
size = "small",
- srcs = ["gtest_output_test.py"],
+ srcs = ["googletest-output-test.py"],
args = select({
":has_absl": [],
"//conditions:default": ["--no_stacktrace_support"],
}),
data = [
- "gtest_output_test_golden_lin.txt",
- ":gtest_output_test_",
+ "googletest-output-test-golden-lin.txt",
+ ":googletest-output-test_",
],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_color_test_",
+ name = "googletest-color-test_",
testonly = 1,
- srcs = ["gtest_color_test_.cc"],
+ srcs = ["googletest-color-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_color_test",
+ name = "googletest-color-test",
size = "small",
- srcs = ["gtest_color_test.py"],
- data = [":gtest_color_test_"],
+ srcs = ["googletest-color-test.py"],
+ data = [":googletest-color-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_env_var_test_",
+ name = "googletest-env-var-test_",
testonly = 1,
- srcs = ["gtest_env_var_test_.cc"],
+ srcs = ["googletest-env-var-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_env_var_test",
- size = "small",
- srcs = ["gtest_env_var_test.py"],
- data = [":gtest_env_var_test_"],
+ name = "googletest-env-var-test",
+ size = "medium",
+ srcs = ["googletest-env-var-test.py"],
+ data = [":googletest-env-var-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_filter_unittest_",
+ name = "googletest-filter-unittest_",
testonly = 1,
- srcs = ["gtest_filter_unittest_.cc"],
+ srcs = ["googletest-filter-unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_filter_unittest",
- size = "small",
- srcs = ["gtest_filter_unittest.py"],
- data = [":gtest_filter_unittest_"],
+ name = "googletest-filter-unittest",
+ size = "medium",
+ srcs = ["googletest-filter-unittest.py"],
+ data = [":googletest-filter-unittest_"],
deps = [":gtest_test_utils"],
)
+
cc_binary(
- name = "gtest_break_on_failure_unittest_",
+ name = "googletest-break-on-failure-unittest_",
testonly = 1,
- srcs = ["gtest_break_on_failure_unittest_.cc"],
+ srcs = ["googletest-break-on-failure-unittest_.cc"],
deps = ["//:gtest"],
)
+
+
py_test(
- name = "gtest_break_on_failure_unittest",
+ name = "googletest-break-on-failure-unittest",
size = "small",
- srcs = ["gtest_break_on_failure_unittest.py"],
- data = [":gtest_break_on_failure_unittest_"],
+ srcs = ["googletest-break-on-failure-unittest.py"],
+ data = [":googletest-break-on-failure-unittest_"],
deps = [":gtest_test_utils"],
)
+
cc_test(
name = "gtest_assert_by_exception_test",
size = "small",
@@ -254,72 +286,75 @@ cc_test(
deps = ["//:gtest"],
)
+
+
cc_binary(
- name = "gtest_throw_on_failure_test_",
+ name = "googletest-throw-on-failure-test_",
testonly = 1,
- srcs = ["gtest_throw_on_failure_test_.cc"],
+ srcs = ["googletest-throw-on-failure-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_throw_on_failure_test",
+ name = "googletest-throw-on-failure-test",
size = "small",
- srcs = ["gtest_throw_on_failure_test.py"],
- data = [":gtest_throw_on_failure_test_"],
+ srcs = ["googletest-throw-on-failure-test.py"],
+ data = [":googletest-throw-on-failure-test_"],
deps = [":gtest_test_utils"],
)
+
cc_binary(
- name = "gtest_list_tests_unittest_",
+ name = "googletest-list-tests-unittest_",
testonly = 1,
- srcs = ["gtest_list_tests_unittest_.cc"],
+ srcs = ["googletest-list-tests-unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_list_tests_unittest",
+ name = "googletest-list-tests-unittest",
size = "small",
- srcs = ["gtest_list_tests_unittest.py"],
- data = [":gtest_list_tests_unittest_"],
+ srcs = ["googletest-list-tests-unittest.py"],
+ data = [":googletest-list-tests-unittest_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_shuffle_test_",
- srcs = ["gtest_shuffle_test_.cc"],
+ name = "googletest-shuffle-test_",
+ srcs = ["googletest-shuffle-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_shuffle_test",
+ name = "googletest-shuffle-test",
size = "small",
- srcs = ["gtest_shuffle_test.py"],
- data = [":gtest_shuffle_test_"],
+ srcs = ["googletest-shuffle-test.py"],
+ data = [":googletest-shuffle-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_catch_exceptions_no_ex_test_",
+ name = "googletest-catch-exceptions-no-ex-test_",
testonly = 1,
- srcs = ["gtest_catch_exceptions_test_.cc"],
+ srcs = ["googletest-catch-exceptions-test_.cc"],
deps = ["//:gtest_main"],
)
cc_binary(
- name = "gtest_catch_exceptions_ex_test_",
+ name = "googletest-catch-exceptions-ex-test_",
testonly = 1,
- srcs = ["gtest_catch_exceptions_test_.cc"],
+ srcs = ["googletest-catch-exceptions-test_.cc"],
copts = ["-fexceptions"],
deps = ["//:gtest_main"],
)
py_test(
- name = "gtest_catch_exceptions_test",
+ name = "googletest-catch-exceptions-test",
size = "small",
- srcs = ["gtest_catch_exceptions_test.py"],
+ srcs = ["googletest-catch-exceptions-test.py"],
data = [
- ":gtest_catch_exceptions_ex_test_",
- ":gtest_catch_exceptions_no_ex_test_",
+ ":googletest-catch-exceptions-ex-test_",
+ ":googletest-catch-exceptions-no-ex-test_",
],
deps = [":gtest_test_utils"],
)
@@ -387,17 +422,17 @@ py_test(
)
cc_binary(
- name = "gtest_uninitialized_test_",
+ name = "googletest-uninitialized-test_",
testonly = 1,
- srcs = ["gtest_uninitialized_test_.cc"],
+ srcs = ["googletest-uninitialized-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_uninitialized_test",
+ name = "googletest-uninitialized-test",
size = "medium",
- srcs = ["gtest_uninitialized_test.py"],
- data = [":gtest_uninitialized_test_"],
+ srcs = ["googletest-uninitialized-test.py"],
+ data = ["googletest-uninitialized-test_"],
deps = [":gtest_test_utils"],
)
@@ -416,3 +451,77 @@ py_test(
data = [":gtest_testbridge_test_"],
deps = [":gtest_test_utils"],
)
+
+
+py_test(
+ name = "googletest-json-outfiles-test",
+ size = "small",
+ srcs = [
+ "googletest-json-outfiles-test.py",
+ "gtest_json_test_utils.py",
+ ],
+ data = [
+ ":gtest_xml_outfile1_test_",
+ ":gtest_xml_outfile2_test_",
+ ],
+ deps = [":gtest_test_utils"],
+)
+
+py_test(
+ name = "googletest-json-output-unittest",
+ size = "medium",
+ srcs = [
+ "googletest-json-output-unittest.py",
+ "gtest_json_test_utils.py",
+ ],
+ data = [
+ # We invoke gtest_no_test_unittest to verify the JSON output
+ # when the test program contains no test definition.
+ ":gtest_no_test_unittest",
+ ":gtest_xml_output_unittest_",
+ ],
+ args = select({
+ ":has_absl": [],
+ "//conditions:default": ["--no_stacktrace_support"],
+ }),
+ deps = [":gtest_test_utils"],
+)
+# Verifies interaction of death tests and exceptions.
+cc_test(
+ name = "googletest-death-test_ex_catch_test",
+ size = "medium",
+ srcs = ["googletest-death-test_ex_test.cc"],
+ copts = ["-fexceptions"],
+ defines = ["GTEST_ENABLE_CATCH_EXCEPTIONS_=1"],
+ deps = ["//:gtest"],
+)
+
+cc_binary(
+ name = "googletest-param-test-invalid-name1-test_",
+ testonly = 1,
+ srcs = ["googletest-param-test-invalid-name1-test_.cc"],
+ deps = ["//:gtest"],
+)
+
+cc_binary(
+ name = "googletest-param-test-invalid-name2-test_",
+ testonly = 1,
+ srcs = ["googletest-param-test-invalid-name2-test_.cc"],
+ deps = ["//:gtest"],
+)
+
+py_test(
+ name = "googletest-param-test-invalid-name1-test",
+ size = "small",
+ srcs = ["googletest-param-test-invalid-name1-test.py"],
+ data = [":googletest-param-test-invalid-name1-test_"],
+ deps = [":gtest_test_utils"],
+)
+
+py_test(
+ name = "googletest-param-test-invalid-name2-test",
+ size = "small",
+ srcs = ["googletest-param-test-invalid-name2-test.py"],
+ data = [":googletest-param-test-invalid-name2-test_"],
+ deps = [":gtest_test_utils"],
+)
diff --git a/googletest/test/gtest_break_on_failure_unittest.py b/googletest/test/googletest-break-on-failure-unittest.py
index 16e19dbc..a5dfbc69 100755
--- a/googletest/test/gtest_break_on_failure_unittest.py
+++ b/googletest/test/googletest-break-on-failure-unittest.py
@@ -34,12 +34,10 @@
A user can ask Google Test to seg-fault when an assertion fails, using
either the GTEST_BREAK_ON_FAILURE environment variable or the
--gtest_break_on_failure flag. This script tests such functionality
-by invoking gtest_break_on_failure_unittest_ (a program written with
+by invoking googletest-break-on-failure-unittest_ (a program written with
Google Test) with different environments and command line flags.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -59,9 +57,9 @@ THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
# The environment variable for enabling/disabling the catch-exceptions mode.
CATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS'
-# Path to the gtest_break_on_failure_unittest_ program.
+# Path to the googletest-break-on-failure-unittest_ program.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_break_on_failure_unittest_')
+ 'googletest-break-on-failure-unittest_')
environ = gtest_test_utils.environ
@@ -95,7 +93,7 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
"""
def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault):
- """Runs gtest_break_on_failure_unittest_ and verifies that it does
+ """Runs googletest-break-on-failure-unittest_ and verifies that it does
(or does not) have a seg-fault.
Args:
diff --git a/googletest/test/gtest_break_on_failure_unittest_.cc b/googletest/test/googletest-break-on-failure-unittest_.cc
index 1231ec28..f84957a2 100644
--- a/googletest/test/gtest_break_on_failure_unittest_.cc
+++ b/googletest/test/googletest-break-on-failure-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Unit test for Google Test's break-on-failure mode.
//
diff --git a/googletest/test/gtest_catch_exceptions_test.py b/googletest/test/googletest-catch-exceptions-test.py
index 760f914f..5d49c102 100755
--- a/googletest/test/gtest_catch_exceptions_test.py
+++ b/googletest/test/googletest-catch-exceptions-test.py
@@ -30,13 +30,11 @@
"""Tests Google Test's exception catching behavior.
-This script invokes gtest_catch_exceptions_test_ and
-gtest_catch_exceptions_ex_test_ (programs written with
+This script invokes googletest-catch-exceptions-test_ and
+googletest-catch-exceptions-ex-test_ (programs written with
Google Test) and verifies their output.
"""
-__author__ = 'vladl@google.com (Vlad Losev)'
-
import gtest_test_utils
# Constants.
@@ -45,15 +43,15 @@ LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
FILTER_FLAG = FLAG_PREFIX + 'filter'
-# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
+# Path to the googletest-catch-exceptions-ex-test_ binary, compiled with
# exceptions enabled.
EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_ex_test_')
+ 'googletest-catch-exceptions-ex-test_')
-# Path to the gtest_catch_exceptions_test_ binary, compiled with
+# Path to the googletest-catch-exceptions-test_ binary, compiled with
# exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_no_ex_test_')
+ 'googletest-catch-exceptions-no-ex-test_')
environ = gtest_test_utils.environ
SetEnvVar = gtest_test_utils.SetEnvVar
diff --git a/googletest/test/gtest_catch_exceptions_test_.cc b/googletest/test/googletest-catch-exceptions-test_.cc
index c6d953c0..09dae700 100644
--- a/googletest/test/gtest_catch_exceptions_test_.cc
+++ b/googletest/test/googletest-catch-exceptions-test_.cc
@@ -26,17 +26,17 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. Tests in this file throw C++ or SEH
-// exceptions, and the output is verified by gtest_catch_exceptions_test.py.
-
-#include "gtest/gtest.h"
+// exceptions, and the output is verified by
+// googletest-catch-exceptions-test.py.
#include <stdio.h> // NOLINT
#include <stdlib.h> // For exit().
+#include "gtest/gtest.h"
+
#if GTEST_HAS_SEH
# include <windows.h>
#endif
diff --git a/googletest/test/gtest_color_test.py b/googletest/test/googletest-color-test.py
index 49b8ed2d..f3b7c999 100755
--- a/googletest/test/gtest_color_test.py
+++ b/googletest/test/googletest-color-test.py
@@ -31,8 +31,6 @@
"""Verifies that Google Test correctly determines whether to use colors."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -40,7 +38,7 @@ IS_WINDOWS = os.name == 'nt'
COLOR_ENV_VAR = 'GTEST_COLOR'
COLOR_FLAG = 'gtest_color'
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-color-test_')
def SetEnvVar(env_var, value):
@@ -53,7 +51,7 @@ def SetEnvVar(env_var, value):
def UsesColor(term, color_env_var, color_flag):
- """Runs gtest_color_test_ and returns its exit code."""
+ """Runs googletest-color-test_ and returns its exit code."""
SetEnvVar('TERM', term)
SetEnvVar(COLOR_ENV_VAR, color_env_var)
diff --git a/googletest/test/gtest_color_test_.cc b/googletest/test/googletest-color-test_.cc
index f9a21e2d..220a3a00 100644
--- a/googletest/test/gtest_color_test_.cc
+++ b/googletest/test/googletest-color-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// A helper program for testing how Google Test determines whether to use
// colors in the output. It prints "YES" and returns 1 if Google Test
diff --git a/googletest/test/gtest-death-test_test.cc b/googletest/test/googletest-death-test-test.cc
index 37261cb6..c0c3026f 100644
--- a/googletest/test/gtest-death-test_test.cc
+++ b/googletest/test/googletest-death-test-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for death tests.
@@ -784,7 +783,7 @@ static void TestExitMacros() {
// Of all signals effects on the process exit code, only those of SIGABRT
// are documented on Windows.
- // See http://msdn.microsoft.com/en-us/library/dwwzkt4c(VS.71).aspx.
+ // See https://msdn.microsoft.com/en-us/query-bi/m/dwwzkt4c.
EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
# elif !GTEST_OS_FUCHSIA
@@ -1280,7 +1279,7 @@ TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
# if GTEST_OS_WINDOWS
TEST(EnvironmentTest, HandleFitsIntoSizeT) {
- // TODO(vladl@google.com): Remove this test after this condition is verified
+ // FIXME: Remove this test after this condition is verified
// in a static assertion in gtest-death-test.cc in the function
// GetStatusFileDescriptor.
ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
diff --git a/googletest/test/gtest-death-test_ex_test.cc b/googletest/test/googletest-death-test_ex_test.cc
index b50a13d5..b8b9470f 100644
--- a/googletest/test/gtest-death-test_ex_test.cc
+++ b/googletest/test/googletest-death-test_ex_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests that verify interaction of exceptions and death tests.
@@ -69,7 +68,7 @@ TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
"exceptional message");
// Verifies that the location is mentioned in the failure text.
EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "gtest-death-test_ex_test.cc");
+ "googletest-death-test_ex_test.cc");
}
# endif // GTEST_HAS_EXCEPTIONS
diff --git a/googletest/test/gtest_env_var_test.py b/googletest/test/googletest-env-var-test.py
index beb2a8b0..e1efeee1 100755
--- a/googletest/test/gtest_env_var_test.py
+++ b/googletest/test/googletest-env-var-test.py
@@ -31,8 +31,6 @@
"""Verifies that Google Test correctly parses environment variables."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -40,7 +38,7 @@ import gtest_test_utils
IS_WINDOWS = os.name == 'nt'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_env_var_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-env-var-test_')
environ = os.environ.copy()
@@ -62,7 +60,7 @@ def SetEnvVar(env_var, value):
def GetFlag(flag):
- """Runs gtest_env_var_test_ and returns its output."""
+ """Runs googletest-env-var-test_ and returns its output."""
args = [COMMAND]
if flag is not None:
diff --git a/googletest/test/gtest_env_var_test_.cc b/googletest/test/googletest-env-var-test_.cc
index 9b668dc0..fd2aa82f 100644
--- a/googletest/test/gtest_env_var_test_.cc
+++ b/googletest/test/googletest-env-var-test_.cc
@@ -26,16 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// A helper program for testing that Google Test parses the environment
// variables correctly.
-#include "gtest/gtest.h"
-
#include <iostream>
+#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h"
using ::std::cout;
@@ -115,7 +113,7 @@ int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
if (argc != 2) {
- cout << "Usage: gtest_env_var_test_ NAME_OF_FLAG\n";
+ cout << "Usage: googletest-env-var-test_ NAME_OF_FLAG\n";
return 1;
}
diff --git a/googletest/test/gtest-filepath_test.cc b/googletest/test/googletest-filepath-test.cc
index 29cea3d1..37f02fb4 100644
--- a/googletest/test/gtest-filepath_test.cc
+++ b/googletest/test/googletest-filepath-test.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// Google Test filepath utilities
//
// This file tests classes and functions used internally by
@@ -51,7 +50,7 @@ namespace internal {
namespace {
#if GTEST_OS_WINDOWS_MOBILE
-// TODO(wan@google.com): Move these to the POSIX adapter section in
+// FIXME: Move these to the POSIX adapter section in
// gtest-port.h.
// Windows CE doesn't have the remove C function.
diff --git a/googletest/test/gtest_filter_unittest.py b/googletest/test/googletest-filter-unittest.py
index 92cc77c8..dc0b5bd9 100755
--- a/googletest/test/gtest_filter_unittest.py
+++ b/googletest/test/googletest-filter-unittest.py
@@ -33,15 +33,13 @@
A user can specify which test(s) in a Google Test program to run via either
the GTEST_FILTER environment variable or the --gtest_filter flag.
This script tests such functionality by invoking
-gtest_filter_unittest_ (a program written with Google Test) with different
+googletest-filter-unittest_ (a program written with Google Test) with different
environments and command line flags.
Note that test sharding may also influence which tests are filtered. Therefore,
we test that here also.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import re
import sets
@@ -100,8 +98,8 @@ FILTER_FLAG = 'gtest_filter'
# The command line flag for including disabled tests.
ALSO_RUN_DISABLED_TESTS_FLAG = 'gtest_also_run_disabled_tests'
-# Command to run the gtest_filter_unittest_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_filter_unittest_')
+# Command to run the googletest-filter-unittest_ program.
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-filter-unittest_')
# Regex for determining whether parameterized tests are enabled in the binary.
PARAM_TEST_REGEX = re.compile(r'/ParamTest')
@@ -120,7 +118,7 @@ LIST_TESTS_FLAG = '--gtest_list_tests'
SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
[COMMAND, LIST_TESTS_FLAG]).output
-# Full names of all tests in gtest_filter_unittests_.
+# Full names of all tests in googletest-filter-unittests_.
PARAM_TESTS = [
'SeqP/ParamTest.TestX/0',
'SeqP/ParamTest.TestX/1',
@@ -292,7 +290,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
args=None, check_exit_0=False):
"""Checks that binary runs correct tests for the given filter and shard.
- Runs all shards of gtest_filter_unittest_ with the given filter, and
+ Runs all shards of googletest-filter-unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.
If check_exit_0, .
@@ -330,7 +328,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
"""Checks that the binary runs correct set of tests for the given filter.
- Runs gtest_filter_unittest_ with the given filter, and enables
+ Runs googletest-filter-unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.
Args:
diff --git a/googletest/test/gtest_filter_unittest_.cc b/googletest/test/googletest-filter-unittest_.cc
index e74a7a38..d335b603 100644
--- a/googletest/test/gtest_filter_unittest_.cc
+++ b/googletest/test/googletest-filter-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Unit test for Google Test test filters.
//
diff --git a/googletest/test/gtest_json_outfiles_test.py b/googletest/test/googletest-json-outfiles-test.py
index 46010d89..c99be48e 100644
--- a/googletest/test/gtest_json_outfiles_test.py
+++ b/googletest/test/googletest-json-outfiles-test.py
@@ -136,11 +136,11 @@ class GTestJsonOutFilesTest(gtest_test_utils.TestCase):
self.assert_(p.exited)
self.assertEquals(0, p.exit_code)
- # TODO(wan@google.com): libtool causes the built test binary to be
+ # FIXME: libtool causes the built test binary to be
# named lt-gtest_xml_outfiles_test_ instead of
# gtest_xml_outfiles_test_. To account for this possibility, we
# allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
+ # when libtool replacement tool is ready.
output_file_name1 = test_name + '.json'
output_file1 = os.path.join(self.output_dir_, output_file_name1)
output_file_name2 = 'lt-' + output_file_name1
diff --git a/googletest/test/gtest_json_output_unittest.py b/googletest/test/googletest-json-output-unittest.py
index 12047c4f..57dcd5fa 100644
--- a/googletest/test/gtest_json_output_unittest.py
+++ b/googletest/test/googletest-json-output-unittest.py
@@ -46,7 +46,10 @@ GTEST_OUTPUT_FLAG = '--gtest_output'
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.json'
GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_'
-SUPPORTS_STACK_TRACES = False
+# The flag indicating stacktraces are not supported
+NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
+
+SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
@@ -607,5 +610,9 @@ class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
if __name__ == '__main__':
+ if NO_STACKTRACE_SUPPORT_FLAG in sys.argv:
+ # unittest.main() can't handle unknown flags
+ sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
+
os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
gtest_test_utils.Main()
diff --git a/googletest/test/gtest-linked_ptr_test.cc b/googletest/test/googletest-linked-ptr-test.cc
index 6fcf5124..fa00f342 100644
--- a/googletest/test/gtest-linked_ptr_test.cc
+++ b/googletest/test/googletest-linked-ptr-test.cc
@@ -26,13 +26,10 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: Dan Egnor (egnor@google.com)
-// Ported to Windows: Vadim Berman (vadimb@google.com)
-
-#include "gtest/internal/gtest-linked_ptr.h"
#include <stdlib.h>
+
+#include "gtest/internal/gtest-linked_ptr.h"
#include "gtest/gtest.h"
namespace {
diff --git a/googletest/test/gtest_list_tests_unittest.py b/googletest/test/googletest-list-tests-unittest.py
index ebf1a3c9..81423a33 100755
--- a/googletest/test/gtest_list_tests_unittest.py
+++ b/googletest/test/googletest-list-tests-unittest.py
@@ -33,12 +33,10 @@
A user can ask Google Test to list all tests by specifying the
--gtest_list_tests flag. This script tests such functionality
-by invoking gtest_list_tests_unittest_ (a program written with
+by invoking googletest-list-tests-unittest_ (a program written with
Google Test) the command line flags.
"""
-__author__ = 'phanna@google.com (Patrick Hanna)'
-
import re
import gtest_test_utils
@@ -47,10 +45,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling listing all tests.
LIST_TESTS_FLAG = 'gtest_list_tests'
-# Path to the gtest_list_tests_unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_list_tests_unittest_')
+# Path to the googletest-list-tests-unittest_ program.
+EXE_PATH = gtest_test_utils.GetTestExecutablePath('googletest-list-tests-unittest_')
-# The expected output when running gtest_list_tests_unittest_ with
+# The expected output when running googletest-list-tests-unittest_ with
# --gtest_list_tests
EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\.
Test1
@@ -94,7 +92,7 @@ MyInstantiation/ValueParamTest\.
TestB/2 # GetParam\(\) = a very\\nlo{241}\.\.\.
""")
-# The expected output when running gtest_list_tests_unittest_ with
+# The expected output when running googletest-list-tests-unittest_ with
# --gtest_list_tests and --gtest_filter=Foo*.
EXPECTED_OUTPUT_FILTER_FOO_RE = re.compile(r"""FooDeathTest\.
Test1
@@ -114,7 +112,7 @@ FooTest\.
def Run(args):
- """Runs gtest_list_tests_unittest_ and returns the list of tests printed."""
+ """Runs googletest-list-tests-unittest_ and returns the list of tests printed."""
return gtest_test_utils.Subprocess([EXE_PATH] + args,
capture_stderr=False).output
@@ -127,7 +125,7 @@ class GTestListTestsUnitTest(gtest_test_utils.TestCase):
"""Tests using the --gtest_list_tests flag to list all tests."""
def RunAndVerify(self, flag_value, expected_output_re, other_flag):
- """Runs gtest_list_tests_unittest_ and verifies that it prints
+ """Runs googletest-list-tests-unittest_ and verifies that it prints
the correct tests.
Args:
diff --git a/googletest/test/gtest_list_tests_unittest_.cc b/googletest/test/googletest-list-tests-unittest_.cc
index 907c176b..f473c7d1 100644
--- a/googletest/test/gtest_list_tests_unittest_.cc
+++ b/googletest/test/googletest-list-tests-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: phanna@google.com (Patrick Hanna)
+
// Unit test for Google Test's --gtest_list_tests flag.
//
diff --git a/googletest/test/gtest-listener_test.cc b/googletest/test/googletest-listener-test.cc
index 639529c5..83555971 100644
--- a/googletest/test/gtest-listener_test.cc
+++ b/googletest/test/googletest-listener-test.cc
@@ -25,17 +25,17 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This file verifies Google Test event listeners receive events at the
// right times.
-#include "gtest/gtest.h"
#include <vector>
+#include "gtest/gtest.h"
+
using ::testing::AddGlobalTestEnvironment;
using ::testing::Environment;
using ::testing::InitGoogleTest;
diff --git a/googletest/test/gtest-message_test.cc b/googletest/test/googletest-message-test.cc
index 175238ef..c6445853 100644
--- a/googletest/test/gtest-message_test.cc
+++ b/googletest/test/googletest-message-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for the Message class.
diff --git a/googletest/test/gtest-options_test.cc b/googletest/test/googletest-options-test.cc
index 3db06e01..c58026a2 100644
--- a/googletest/test/gtest-options_test.cc
+++ b/googletest/test/googletest-options-test.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// Google Test UnitTestOptions tests
//
// This file tests classes and functions used internally by
@@ -99,17 +98,16 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
const std::string exe_str = GetCurrentExecutableName().string();
#if GTEST_OS_WINDOWS
const bool success =
- _strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
+ _strcmpi("googletest-options-test", exe_str.c_str()) == 0 ||
_strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
#elif GTEST_OS_FUCHSIA
const bool success = exe_str == "app";
#else
- // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
- // Chandler Carruth's libtool replacement is ready.
+ // FIXME: remove the hard-coded "lt-" prefix when libtool replacement is ready
const bool success =
- exe_str == "gtest-options_test" ||
+ exe_str == "googletest-options-test" ||
exe_str == "gtest_all_test" ||
exe_str == "lt-gtest_all_test" ||
exe_str == "gtest_dll_test"
diff --git a/googletest/test/gtest_output_test_golden_lin.txt b/googletest/test/googletest-output-test-golden-lin.txt
index 02a77a8e..86da845b 100644
--- a/googletest/test/gtest_output_test_golden_lin.txt
+++ b/googletest/test/googletest-output-test-golden-lin.txt
@@ -1,18 +1,18 @@
The non-test part of the code is expected to have 2 failures.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
3
Stack trace: (omitted)
-[==========] Running 68 tests from 30 test cases.
+[==========] Running 76 tests from 34 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
@@ -38,7 +38,7 @@ BarEnvironment::SetUp() called.
[ OK ] PassingTest.PassingTest2
[----------] 2 tests from NonfatalFailureTest
[ RUN ] NonfatalFailureTest.EscapesStringOperands
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
kGoldenString
Which is: "\"Line"
@@ -46,7 +46,7 @@ Expected equality of these values:
Which is: "actual \"string\""
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
golden
Which is: "\"Line"
@@ -56,7 +56,7 @@ Stack trace: (omitted)
[ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ RUN ] NonfatalFailureTest.DiffForLongStrings
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
golden_str
Which is: "\"Line\0 1\"\nLine 2"
@@ -72,7 +72,7 @@ Stack trace: (omitted)
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
@@ -82,7 +82,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
@@ -92,7 +92,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
@@ -104,45 +104,45 @@ Stack trace: (omitted)
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
Stack trace: (omitted)
i == 2
i == 3
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
Stack trace: (omitted)
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
[----------] 7 tests from SCOPED_TRACETest
[ RUN ] SCOPED_TRACETest.AcceptedValues
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Just checking that all these values work fine.
Google Test trace:
-gtest_output_test_.cc:#: (null)
-gtest_output_test_.cc:#: 1337
-gtest_output_test_.cc:#: std::string
-gtest_output_test_.cc:#: literal string
+googletest-output-test_.cc:#: (null)
+googletest-output-test_.cc:#: 1337
+googletest-output-test_.cc:#: std::string
+googletest-output-test_.cc:#: literal string
Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.AcceptedValues
[ RUN ] SCOPED_TRACETest.ObeysScopes
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and shouldn't have a trace.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should have a trace.
Google Test trace:
-gtest_output_test_.cc:#: Expected trace
+googletest-output-test_.cc:#: Expected trace
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and shouldn't have a trace.
Stack trace: (omitted)
@@ -150,131 +150,131 @@ Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.ObeysScopes
[ RUN ] SCOPED_TRACETest.WorksInLoop
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
n
Which is: 1
Google Test trace:
-gtest_output_test_.cc:#: i = 1
+googletest-output-test_.cc:#: i = 1
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: i = 2
+googletest-output-test_.cc:#: i = 2
Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
n
Which is: 1
Google Test trace:
-gtest_output_test_.cc:#: n = 1
+googletest-output-test_.cc:#: n = 1
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: n = 2
+googletest-output-test_.cc:#: n = 2
Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: n = 2
-gtest_output_test_.cc:#:
+googletest-output-test_.cc:#: n = 2
+googletest-output-test_.cc:#:
Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.CanBeNested
[ RUN ] SCOPED_TRACETest.CanBeRepeated
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A.
Google Test trace:
-gtest_output_test_.cc:#: A
+googletest-output-test_.cc:#: A
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A and B.
Google Test trace:
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and C.
Google Test trace:
-gtest_output_test_.cc:#: C
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
+googletest-output-test_.cc:#: C
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and D.
Google Test trace:
-gtest_output_test_.cc:#: D
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
+googletest-output-test_.cc:#: D
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.CanBeRepeated
[ RUN ] SCOPED_TRACETest.WorksConcurrently
(expecting 6 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1 (in thread B, only trace B alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace B
+googletest-output-test_.cc:#: Trace B
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2 (in thread A, trace A & B both alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace A
+googletest-output-test_.cc:#: Trace A
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3 (in thread B, trace A & B both alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace B
+googletest-output-test_.cc:#: Trace B
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4 (in thread B, only trace A alive).
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #5 (in thread A, only trace A alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace A
+googletest-output-test_.cc:#: Trace A
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #6 (in thread A, no trace alive).
Stack trace: (omitted)
@@ -282,7 +282,7 @@ Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksConcurrently
[----------] 1 test from ScopedTraceTest
[ RUN ] ScopedTraceTest.WithExplicitFileAndLine
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Check that the trace is attached to a particular location.
Google Test trace:
@@ -293,27 +293,27 @@ Stack trace: (omitted)
[----------] 1 test from NonFatalFailureInFixtureConstructorTest
[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 5 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in SetUp().
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in the test body.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4, in TearDown.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #5, in the test fixture d'tor.
Stack trace: (omitted)
@@ -322,12 +322,12 @@ Stack trace: (omitted)
[----------] 1 test from FatalFailureInFixtureConstructorTest
[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in the test fixture d'tor.
Stack trace: (omitted)
@@ -336,22 +336,22 @@ Stack trace: (omitted)
[----------] 1 test from NonFatalFailureInSetUpTest
[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
(expecting 4 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in the test function.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in TearDown().
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4, in the test fixture d'tor.
Stack trace: (omitted)
@@ -360,17 +360,17 @@ Stack trace: (omitted)
[----------] 1 test from FatalFailureInSetUpTest
[ RUN ] FatalFailureInSetUpTest.FailureInSetUp
(expecting 3 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in TearDown().
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in the test fixture d'tor.
Stack trace: (omitted)
@@ -483,13 +483,13 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 2 failures
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 1.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 2.
Stack trace: (omitted)
@@ -503,7 +503,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -548,13 +548,13 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 2 failures
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -568,7 +568,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -597,7 +597,7 @@ Stack trace: (omitted)
[ RUN ] TypedTest/0.Success
[ OK ] TypedTest/0.Success
[ RUN ] TypedTest/0.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
TypeParam()
@@ -606,11 +606,29 @@ Expected failure
Stack trace: (omitted)
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
+[----------] 2 tests from TypedTestWithNames/char0, where TypeParam = char
+[ RUN ] TypedTestWithNames/char0.Success
+[ OK ] TypedTestWithNames/char0.Success
+[ RUN ] TypedTestWithNames/char0.Failure
+googletest-output-test_.cc:#: Failure
+Failed
+Stack trace: (omitted)
+
+[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char
+[----------] 2 tests from TypedTestWithNames/int1, where TypeParam = int
+[ RUN ] TypedTestWithNames/int1.Success
+[ OK ] TypedTestWithNames/int1.Success
+[ RUN ] TypedTestWithNames/int1.Failure
+googletest-output-test_.cc:#: Failure
+Failed
+Stack trace: (omitted)
+
+[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1U
Which is: 1
@@ -624,7 +642,7 @@ Stack trace: (omitted)
[ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1U
Which is: 1
@@ -634,13 +652,41 @@ Expected failure
Stack trace: (omitted)
[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
+[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedChar0, where TypeParam = unsigned char
+[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Success
+[ OK ] UnsignedCustomName/TypedTestP/unsignedChar0.Success
+[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure
+googletest-output-test_.cc:#: Failure
+Expected equality of these values:
+ 1U
+ Which is: 1
+ TypeParam()
+ Which is: '\0'
+Expected failure
+Stack trace: (omitted)
+
+[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char
+[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedInt1, where TypeParam = unsigned int
+[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Success
+[ OK ] UnsignedCustomName/TypedTestP/unsignedInt1.Success
+[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure
+googletest-output-test_.cc:#: Failure
+Expected equality of these values:
+ 1U
+ Which is: 1
+ TypeParam()
+ Which is: 0
+Expected failure
+Stack trace: (omitted)
+
+[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int
[----------] 4 tests from ExpectFailureTest
[ RUN ] ExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
Stack trace: (omitted)
@@ -651,7 +697,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -663,7 +709,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -677,7 +723,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
Stack trace: (omitted)
@@ -688,7 +734,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -700,7 +746,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -714,7 +760,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
Stack trace: (omitted)
@@ -725,7 +771,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -737,7 +783,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -751,7 +797,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
Stack trace: (omitted)
@@ -762,7 +808,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -774,7 +820,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -786,7 +832,7 @@ Stack trace: (omitted)
[----------] 2 tests from ExpectFailureWithThreadsTest
[ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
Stack trace: (omitted)
@@ -799,7 +845,7 @@ Stack trace: (omitted)
[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
[ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -813,12 +859,12 @@ Stack trace: (omitted)
[----------] 1 test from ScopedFakeTestPartResultReporterTest
[ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
Stack trace: (omitted)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
Stack trace: (omitted)
@@ -826,7 +872,7 @@ Stack trace: (omitted)
[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[----------] 1 test from PrintingFailingParams/FailingParamTest
[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
GetParam()
@@ -838,7 +884,7 @@ Stack trace: (omitted)
[ RUN ] PrintingStrings/ParamTest.Success/a
[ OK ] PrintingStrings/ParamTest.Success/a
[ RUN ] PrintingStrings/ParamTest.Failure/a
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
"b"
GetParam()
@@ -849,20 +895,20 @@ Stack trace: (omitted)
[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
Stack trace: (omitted)
FooEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
Stack trace: (omitted)
-[==========] 68 tests from 30 test cases ran.
-[ PASSED ] 22 tests.
-[ FAILED ] 46 tests, listed below:
+[==========] 76 tests from 34 test cases ran.
+[ PASSED ] 26 tests.
+[ FAILED ] 50 tests, listed below:
[ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ FAILED ] NonfatalFailureTest.DiffForLongStrings
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
@@ -898,8 +944,12 @@ Stack trace: (omitted)
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
+[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char
+[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int
[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
+[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char
+[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int
[ FAILED ] ExpectFailureTest.ExpectFatalFailure
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
@@ -910,7 +960,7 @@ Stack trace: (omitted)
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
-46 FAILED TESTS
+50 FAILED TESTS
 YOU HAVE 1 DISABLED TEST
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
@@ -919,7 +969,7 @@ Stack trace: (omitted)
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
@@ -929,7 +979,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
@@ -939,7 +989,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
@@ -953,13 +1003,13 @@ Stack trace: (omitted)
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
Stack trace: (omitted)
i == 2
i == 3
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
Stack trace: (omitted)
diff --git a/googletest/test/gtest_output_test.py b/googletest/test/googletest-output-test.py
index 63763b95..2d69e353 100755
--- a/googletest/test/gtest_output_test.py
+++ b/googletest/test/googletest-output-test.py
@@ -31,16 +31,13 @@
"""Tests the text output of Google C++ Testing and Mocking Framework.
-
-SYNOPSIS
- gtest_output_test.py --build_dir=BUILD/DIR --gengolden
- # where BUILD/DIR contains the built gtest_output_test_ file.
- gtest_output_test.py --gengolden
- gtest_output_test.py
+To update the golden file:
+googletest_output_test.py --build_dir=BUILD/DIR --gengolden
+where BUILD/DIR contains the built googletest-output-test_ file.
+googletest_output_test.py --gengolden
+googletest_output_test.py
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import difflib
import os
import re
@@ -58,10 +55,10 @@ NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
-# TODO(vladl@google.com): remove the _lin suffix.
-GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
+# FIXME: remove the _lin suffix.
+GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_')
+PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
# At least one command we exercise must not have the
# 'internal_skip_environment_and_ad_hoc_tests' argument.
@@ -104,7 +101,7 @@ def RemoveLocations(test_output):
'FILE_NAME:#: '.
"""
- return re.sub(r'.*[/\\]((gtest_output_test_|gtest).cc)(\:\d+|\(\d+\))\: ',
+ return re.sub(r'.*[/\\]((googletest-output-test_|gtest).cc)(\:\d+|\(\d+\))\: ',
r'\1:#: ', test_output)
@@ -195,7 +192,7 @@ def RemoveMatchingTests(test_output, pattern):
def NormalizeOutput(output):
- """Normalizes output (the output of gtest_output_test_.exe)."""
+ """Normalizes output (the output of googletest-output-test_.exe)."""
output = ToUnixLineEnding(output)
output = RemoveLocations(output)
@@ -316,11 +313,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
open(os.path.join(
gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_actual.txt'), 'wb').write(
+ '_googletest-output-test_normalized_actual.txt'), 'wb').write(
normalized_actual)
open(os.path.join(
gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_golden.txt'), 'wb').write(
+ '_googletest-output-test_normalized_golden.txt'), 'wb').write(
normalized_golden)
self.assertEqual(normalized_golden, normalized_actual)
diff --git a/googletest/test/gtest_output_test_.cc b/googletest/test/googletest-output-test_.cc
index 9ae9dc60..f6525ec9 100644
--- a/googletest/test/gtest_output_test_.cc
+++ b/googletest/test/googletest-output-test_.cc
@@ -29,11 +29,9 @@
//
// The purpose of this file is to generate Google Test output under
// various conditions. The output will then be verified by
-// gtest_output_test.py to ensure that Google Test generates the
+// googletest-output-test.py to ensure that Google Test generates the
// desired messages. Therefore, most tests in this file are MEANT TO
// FAIL.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
@@ -41,6 +39,10 @@
#include <stdlib.h>
+#if _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */)
+#endif // _MSC_VER
+
#if GTEST_IS_THREADSAFE
using testing::ScopedFakeTestPartResultReporter;
using testing::TestPartResultArray;
@@ -803,6 +805,28 @@ TYPED_TEST(TypedTest, Failure) {
EXPECT_EQ(1, TypeParam()) << "Expected failure";
}
+typedef testing::Types<char, int> TypesForTestWithNames;
+
+template <typename T>
+class TypedTestWithNames : public testing::Test {};
+
+class TypedTestNames {
+ public:
+ template <typename T>
+ static std::string GetName(int i) {
+ if (testing::internal::IsSame<T, char>::value)
+ return std::string("char") + ::testing::PrintToString(i);
+ if (testing::internal::IsSame<T, int>::value)
+ return std::string("int") + ::testing::PrintToString(i);
+ }
+};
+
+TYPED_TEST_CASE(TypedTestWithNames, TypesForTestWithNames, TypedTestNames);
+
+TYPED_TEST(TypedTestWithNames, Success) {}
+
+TYPED_TEST(TypedTestWithNames, Failure) { FAIL(); }
+
#endif // GTEST_HAS_TYPED_TEST
// This #ifdef block tests the output of type-parameterized tests.
@@ -827,6 +851,22 @@ REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes);
+class TypedTestPNames {
+ public:
+ template <typename T>
+ static std::string GetName(int i) {
+ if (testing::internal::IsSame<T, unsigned char>::value) {
+ return std::string("unsignedChar") + ::testing::PrintToString(i);
+ }
+ if (testing::internal::IsSame<T, unsigned int>::value) {
+ return std::string("unsignedInt") + ::testing::PrintToString(i);
+ }
+ }
+};
+
+INSTANTIATE_TYPED_TEST_CASE_P(UnsignedCustomName, TypedTestP, UnsignedTypes,
+ TypedTestPNames);
+
#endif // GTEST_HAS_TYPED_TEST_P
#if GTEST_HAS_DEATH_TEST
@@ -1062,6 +1102,8 @@ int main(int argc, char **argv) {
// are registered, and torn down in the reverse order.
testing::AddGlobalTestEnvironment(new FooEnvironment);
testing::AddGlobalTestEnvironment(new BarEnvironment);
-
+#if _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127
+#endif // _MSC_VER
return RunAllTests();
}
diff --git a/googletest/test/googletest-param-test-invalid-name1-test.py b/googletest/test/googletest-param-test-invalid-name1-test.py
new file mode 100644
index 00000000..2a08477a
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name1-test.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Verifies that Google Test warns the user when not initialized properly."""
+
+import gtest_test_utils
+
+binary_name = 'googletest-param-test-invalid-name1-test_'
+COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
+
+
+def Assert(condition):
+ if not condition:
+ raise AssertionError
+
+
+def TestExitCodeAndOutput(command):
+ """Runs the given command and verifies its exit code and output."""
+
+ err = ('Parameterized test name \'"InvalidWithQuotes"\' is invalid')
+
+ p = gtest_test_utils.Subprocess(command)
+ Assert(p.terminated_by_signal)
+
+ # Verify the output message contains appropriate output
+ Assert(err in p.output)
+
+
+class GTestParamTestInvalidName1Test(gtest_test_utils.TestCase):
+
+ def testExitCodeAndOutput(self):
+ TestExitCodeAndOutput(COMMAND)
+
+
+if __name__ == '__main__':
+ gtest_test_utils.Main()
diff --git a/googletest/test/googletest-param-test-invalid-name1-test_.cc b/googletest/test/googletest-param-test-invalid-name1-test_.cc
new file mode 100644
index 00000000..5a95155b
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name1-test_.cc
@@ -0,0 +1,50 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#include "gtest/gtest.h"
+
+namespace {
+class DummyTest : public ::testing::TestWithParam<const char *> {};
+
+TEST_P(DummyTest, Dummy) {
+}
+
+INSTANTIATE_TEST_CASE_P(InvalidTestName,
+ DummyTest,
+ ::testing::Values("InvalidWithQuotes"),
+ ::testing::PrintToStringParamName());
+
+} // namespace
+
+int main(int argc, char *argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
diff --git a/googletest/test/googletest-param-test-invalid-name2-test.py b/googletest/test/googletest-param-test-invalid-name2-test.py
new file mode 100644
index 00000000..ab838f46
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name2-test.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Verifies that Google Test warns the user when not initialized properly."""
+
+import gtest_test_utils
+
+binary_name = 'googletest-param-test-invalid-name2-test_'
+COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
+
+
+def Assert(condition):
+ if not condition:
+ raise AssertionError
+
+
+def TestExitCodeAndOutput(command):
+ """Runs the given command and verifies its exit code and output."""
+
+ err = ('Duplicate parameterized test name \'a\'')
+
+ p = gtest_test_utils.Subprocess(command)
+ Assert(p.terminated_by_signal)
+
+ # Check for appropriate output
+ Assert(err in p.output)
+
+
+class GTestParamTestInvalidName2Test(gtest_test_utils.TestCase):
+
+ def testExitCodeAndOutput(self):
+ TestExitCodeAndOutput(COMMAND)
+
+if __name__ == '__main__':
+ gtest_test_utils.Main()
diff --git a/googletest/test/googletest-param-test-invalid-name2-test_.cc b/googletest/test/googletest-param-test-invalid-name2-test_.cc
new file mode 100644
index 00000000..ef093490
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name2-test_.cc
@@ -0,0 +1,55 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#include "gtest/gtest.h"
+
+namespace {
+class DummyTest : public ::testing::TestWithParam<const char *> {};
+
+std::string StringParamTestSuffix(
+ const testing::TestParamInfo<const char*>& info) {
+ return std::string(info.param);
+}
+
+TEST_P(DummyTest, Dummy) {
+}
+
+INSTANTIATE_TEST_CASE_P(DuplicateTestNames,
+ DummyTest,
+ ::testing::Values("a", "b", "a", "c"),
+ StringParamTestSuffix);
+} // namespace
+
+int main(int argc, char *argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
+
diff --git a/googletest/test/gtest-param-test_test.cc b/googletest/test/googletest-param-test-test.cc
index adc4d1b5..f789cab2 100644
--- a/googletest/test/gtest-param-test_test.cc
+++ b/googletest/test/googletest-param-test-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. This file verifies that the parameter
// generators objects produce correct parameter sequences and that
@@ -43,7 +42,7 @@
# include <vector>
# include "src/gtest-internal-inl.h" // for UnitTestOptions
-# include "test/gtest-param-test_test.h"
+# include "test/googletest-param-test-test.h"
using ::std::vector;
using ::std::sort;
@@ -68,7 +67,7 @@ using ::testing::internal::UnitTestOptions;
// Prints a value to a string.
//
-// TODO(wan@google.com): remove PrintValue() when we move matchers and
+// FIXME: remove PrintValue() when we move matchers and
// EXPECT_THAT() from Google Mock to Google Test. At that time, we
// can write EXPECT_THAT(x, Eq(y)) to compare two tuples x and y, as
// EXPECT_THAT() and the matchers know how to print tuples.
diff --git a/googletest/test/gtest-param-test_test.h b/googletest/test/googletest-param-test-test.h
index ea1e884f..632a61f4 100644
--- a/googletest/test/gtest-param-test_test.h
+++ b/googletest/test/googletest-param-test-test.h
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev)
-//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file provides classes and functions used internally
diff --git a/googletest/test/gtest-param-test2_test.cc b/googletest/test/googletest-param-test2-test.cc
index c3b2d189..25bb945c 100644
--- a/googletest/test/gtest-param-test2_test.cc
+++ b/googletest/test/googletest-param-test2-test.cc
@@ -26,35 +26,35 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
#include "gtest/gtest.h"
-#include "gtest-param-test_test.h"
+#include "test/googletest-param-test-test.h"
using ::testing::Values;
using ::testing::internal::ParamGenerator;
// Tests that generators defined in a different translation unit
// are functional. The test using extern_gen is defined
-// in gtest-param-test_test.cc.
+// in googletest-param-test-test.cc.
ParamGenerator<int> extern_gen = Values(33);
// Tests that a parameterized test case can be defined in one translation unit
-// and instantiated in another. The test is defined in gtest-param-test_test.cc
-// and ExternalInstantiationTest fixture class is defined in
-// gtest-param-test_test.h.
+// and instantiated in another. The test is defined in
+// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
+// defined in gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P(MultiplesOf33,
ExternalInstantiationTest,
Values(33, 66));
// Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined
-// in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest
-// fixture is defined in gtest-param-test_test.h
+// in googletest-param-test-test.cc and
+// InstantiationInMultipleTranslaionUnitsTest fixture is defined in
+// gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest,
Values(42*3, 42*4, 42*5));
diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/googletest-port-test.cc
index 3801e5ee..399316f9 100644
--- a/googletest/test/gtest-port_test.cc
+++ b/googletest/test/googletest-port-test.cc
@@ -27,14 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
-//
// This file tests the internal cross-platform support utilities.
+#include <stdio.h>
#include "gtest/internal/gtest-port.h"
-#include <stdio.h>
-
#if GTEST_OS_MAC
# include <time.h>
#endif // GTEST_OS_MAC
@@ -227,7 +224,7 @@ TEST(ScopedPtrTest, DefinesElementType) {
StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
}
-// TODO(vladl@google.com): Implement THE REST of scoped_ptr tests.
+// FIXME: Implement THE REST of scoped_ptr tests.
TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
if (AlwaysFalse())
@@ -346,11 +343,11 @@ TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const bool a_false_condition = false;
const char regex[] =
#ifdef _MSC_VER
- "gtest-port_test\\.cc\\(\\d+\\):"
+ "googletest-port-test\\.cc\\(\\d+\\):"
#elif GTEST_USES_POSIX_RE
- "gtest-port_test\\.cc:[0-9]+"
+ "googletest-port-test\\.cc:[0-9]+"
#else
- "gtest-port_test\\.cc:\\d+"
+ "googletest-port-test\\.cc:\\d+"
#endif // _MSC_VER
".*a_false_condition.*Extra info.*";
diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/googletest-printers-test.cc
index 49b3bd46..ea8369d2 100644
--- a/googletest/test/gtest-printers_test.cc
+++ b/googletest/test/googletest-printers-test.cc
@@ -26,15 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Test - The Google C++ Testing and Mocking Framework
//
// This file tests the universal value printer.
-#include "gtest/gtest-printers.h"
-
#include <ctype.h>
#include <limits.h>
#include <string.h>
@@ -48,6 +45,7 @@
#include <utility>
#include <vector>
+#include "gtest/gtest-printers.h"
#include "gtest/gtest.h"
#if GTEST_HAS_UNORDERED_MAP_
@@ -572,7 +570,7 @@ struct Foo {
TEST(PrintPointerTest, MemberVariablePointer) {
EXPECT_TRUE(HasPrefix(Print(&Foo::value),
Print(sizeof(&Foo::value)) + "-byte object "));
- int (Foo::*p) = NULL; // NOLINT
+ int Foo::*p = NULL; // NOLINT
EXPECT_TRUE(HasPrefix(Print(p),
Print(sizeof(p)) + "-byte object "));
}
@@ -920,8 +918,6 @@ TEST(PrintStlContainerTest, MultiSet) {
}
#if GTEST_HAS_STD_FORWARD_LIST_
-// <slist> is available on Linux in the google3 mode, but not on
-// Windows or Mac OS X.
TEST(PrintStlContainerTest, SinglyLinkedList) {
int a[] = { 9, 2, 8 };
@@ -1250,7 +1246,7 @@ TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
// Tests that the universal printer prints a member variable pointer
// passed by reference.
TEST(PrintReferenceTest, HandlesMemberVariablePointer) {
- int (Foo::*p) = &Foo::value; // NOLINT
+ int Foo::*p = &Foo::value; // NOLINT
EXPECT_TRUE(HasPrefix(
PrintByRef(p),
"@" + PrintPointer(&p) + " " + Print(sizeof(p)) + "-byte object "));
@@ -1731,6 +1727,21 @@ TEST(PrintOptionalTest, Basic) {
EXPECT_EQ("(1.1)", PrintToString(absl::optional<double>{1.1}));
EXPECT_EQ("(\"A\")", PrintToString(absl::optional<std::string>{"A"}));
}
+
+struct NonPrintable {
+ unsigned char contents = 17;
+};
+
+TEST(PrintOneofTest, Basic) {
+ using Type = absl::variant<int, StreamableInGlobal, NonPrintable>;
+ EXPECT_EQ("('int' with value 7)", PrintToString(Type(7)));
+ EXPECT_EQ("('StreamableInGlobal' with value StreamableInGlobal)",
+ PrintToString(Type(StreamableInGlobal{})));
+ EXPECT_EQ(
+ "('testing::gtest_printers_test::NonPrintable' with value 1-byte object "
+ "<11>)",
+ PrintToString(Type(NonPrintable{})));
+}
#endif // GTEST_HAS_ABSL
} // namespace gtest_printers_test
diff --git a/googletest/test/gtest_shuffle_test.py b/googletest/test/googletest-shuffle-test.py
index 30d0303d..573cc5ec 100755
--- a/googletest/test/gtest_shuffle_test.py
+++ b/googletest/test/googletest-shuffle-test.py
@@ -30,13 +30,11 @@
"""Verifies that test shuffling works."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
-# Command to run the gtest_shuffle_test_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_shuffle_test_')
+# Command to run the googletest-shuffle-test_ program.
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-shuffle-test_')
# The environment variables for test sharding.
TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
@@ -89,7 +87,7 @@ def GetTestsForAllIterations(extra_env, args):
Args:
extra_env: a map from environment variables to their values
- args: command line flags to pass to gtest_shuffle_test_
+ args: command line flags to pass to googletest-shuffle-test_
Returns:
A list where the i-th element is the list of tests run in the i-th
diff --git a/googletest/test/gtest_shuffle_test_.cc b/googletest/test/googletest-shuffle-test_.cc
index 6fb441bd..1fe5f6ab 100644
--- a/googletest/test/gtest_shuffle_test_.cc
+++ b/googletest/test/googletest-shuffle-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Verifies that test shuffling works.
diff --git a/googletest/test/gtest-test-part_test.cc b/googletest/test/googletest-test-part-test.cc
index ca8ba933..cd2d6f9e 100644
--- a/googletest/test/gtest-test-part_test.cc
+++ b/googletest/test/googletest-test-part-test.cc
@@ -26,9 +26,6 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
#include "gtest/gtest-test-part.h"
@@ -203,6 +200,6 @@ TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
}
-// TODO(mheule@google.com): Add a test for the class HasNewFatalFailureHelper.
+// FIXME: Add a test for the class HasNewFatalFailureHelper.
} // namespace
diff --git a/googletest/test/googletest-test2_test.cc b/googletest/test/googletest-test2_test.cc
new file mode 100644
index 00000000..c2f98dc7
--- /dev/null
+++ b/googletest/test/googletest-test2_test.cc
@@ -0,0 +1,61 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//
+// Tests for Google Test itself. This verifies that the basic constructs of
+// Google Test work.
+
+#include "gtest/gtest.h"
+#include "googletest-param-test-test.h"
+
+using ::testing::Values;
+using ::testing::internal::ParamGenerator;
+
+// Tests that generators defined in a different translation unit
+// are functional. The test using extern_gen_2 is defined
+// in googletest-param-test-test.cc.
+ParamGenerator<int> extern_gen_2 = Values(33);
+
+// Tests that a parameterized test case can be defined in one translation unit
+// and instantiated in another. The test is defined in
+// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
+// defined in gtest-param-test_test.h.
+INSTANTIATE_TEST_CASE_P(MultiplesOf33,
+ ExternalInstantiationTest,
+ Values(33, 66));
+
+// Tests that a parameterized test case can be instantiated
+// in multiple translation units. Another instantiation is defined
+// in googletest-param-test-test.cc and
+// InstantiationInMultipleTranslaionUnitsTest fixture is defined in
+// gtest-param-test_test.h
+INSTANTIATE_TEST_CASE_P(Sequence2,
+ InstantiationInMultipleTranslaionUnitsTest,
+ Values(42*3, 42*4, 42*5));
+
diff --git a/googletest/test/gtest_throw_on_failure_test.py b/googletest/test/googletest-throw-on-failure-test.py
index 5678ffea..46cb9f6d 100755
--- a/googletest/test/gtest_throw_on_failure_test.py
+++ b/googletest/test/googletest-throw-on-failure-test.py
@@ -31,12 +31,10 @@
"""Tests Google Test's throw-on-failure mode with exceptions disabled.
-This script invokes gtest_throw_on_failure_test_ (a program written with
+This script invokes googletest-throw-on-failure-test_ (a program written with
Google Test) with different environments and command line flags.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -46,10 +44,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling the throw-on-failure mode.
THROW_ON_FAILURE = 'gtest_throw_on_failure'
-# Path to the gtest_throw_on_failure_test_ program, compiled with
+# Path to the googletest-throw-on-failure-test_ program, compiled with
# exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_throw_on_failure_test_')
+ 'googletest-throw-on-failure-test_')
# Utilities.
@@ -75,13 +73,13 @@ def Run(command):
return p.exited and p.exit_code == 0
-# The tests. TODO(wan@google.com): refactor the class to share common
-# logic with code in gtest_break_on_failure_unittest.py.
+# The tests. FIXME: refactor the class to share common
+# logic with code in googletest-break-on-failure-unittest.py.
class ThrowOnFailureTest(gtest_test_utils.TestCase):
"""Tests the throw-on-failure mode."""
def RunAndVerify(self, env_var_value, flag_value, should_fail):
- """Runs gtest_throw_on_failure_test_ and verifies that it does
+ """Runs googletest-throw-on-failure-test_ and verifies that it does
(or does not) exit with a non-zero code.
Args:
diff --git a/googletest/test/gtest_throw_on_failure_test_.cc b/googletest/test/googletest-throw-on-failure-test_.cc
index 2b88fe3d..f9a2c644 100644
--- a/googletest/test/gtest_throw_on_failure_test_.cc
+++ b/googletest/test/googletest-throw-on-failure-test_.cc
@@ -26,13 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's throw-on-failure mode with exceptions disabled.
//
// This program must be compiled with exceptions disabled. It will be
-// invoked by gtest_throw_on_failure_test.py, and is expected to exit
+// invoked by googletest-throw-on-failure-test.py, and is expected to exit
// with non-zero in the throw-on-failure mode or 0 otherwise.
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest-tuple_test.cc b/googletest/test/googletest-tuple-test.cc
index bfaa3e0a..dd82c160 100644
--- a/googletest/test/gtest-tuple_test.cc
+++ b/googletest/test/googletest-tuple-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/internal/gtest-tuple.h"
#include <utility>
diff --git a/googletest/test/gtest_uninitialized_test.py b/googletest/test/googletest-uninitialized-test.py
index ae91f2aa..5b7d1e74 100755
--- a/googletest/test/gtest_uninitialized_test.py
+++ b/googletest/test/googletest-uninitialized-test.py
@@ -31,11 +31,9 @@
"""Verifies that Google Test warns the user when not initialized properly."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import gtest_test_utils
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_')
def Assert(condition):
diff --git a/googletest/test/gtest_uninitialized_test_.cc b/googletest/test/googletest-uninitialized-test_.cc
index 2ba0e8b8..b4434d51 100644
--- a/googletest/test/gtest_uninitialized_test_.cc
+++ b/googletest/test/googletest-uninitialized-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest-typed-test2_test.cc b/googletest/test/gtest-typed-test2_test.cc
index ad77c65c..ed96421c 100644
--- a/googletest/test/gtest-typed-test2_test.cc
+++ b/googletest/test/gtest-typed-test2_test.cc
@@ -26,12 +26,11 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include <vector>
-#include "gtest-typed-test_test.h"
+#include "test/gtest-typed-test_test.h"
#include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P
diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc
index 5e1b7b27..4e398697 100644
--- a/googletest/test/gtest-typed-test_test.cc
+++ b/googletest/test/gtest-typed-test_test.cc
@@ -26,16 +26,19 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-#include "gtest-typed-test_test.h"
+
+#include "test/gtest-typed-test_test.h"
#include <set>
#include <vector>
#include "gtest/gtest.h"
+#if _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */)
+#endif // _MSC_VER
+
using testing::Test;
// Used for testing that SetUpTestCase()/TearDownTestCase(), fixture
@@ -166,6 +169,40 @@ TYPED_TEST(NumericTest, DefaultIsZero) {
} // namespace library1
+// Tests that custom names work.
+template <typename T>
+class TypedTestWithNames : public Test {};
+
+class TypedTestNames {
+ public:
+ template <typename T>
+ static std::string GetName(int i) {
+ if (testing::internal::IsSame<T, char>::value) {
+ return std::string("char") + ::testing::PrintToString(i);
+ }
+ if (testing::internal::IsSame<T, int>::value) {
+ return std::string("int") + ::testing::PrintToString(i);
+ }
+ }
+};
+
+TYPED_TEST_CASE(TypedTestWithNames, TwoTypes, TypedTestNames);
+
+TYPED_TEST(TypedTestWithNames, TestCaseName) {
+ if (testing::internal::IsSame<TypeParam, char>::value) {
+ EXPECT_STREQ(::testing::UnitTest::GetInstance()
+ ->current_test_info()
+ ->test_case_name(),
+ "TypedTestWithNames/char0");
+ }
+ if (testing::internal::IsSame<TypeParam, int>::value) {
+ EXPECT_STREQ(::testing::UnitTest::GetInstance()
+ ->current_test_info()
+ ->test_case_name(),
+ "TypedTestWithNames/int1");
+ }
+}
+
#endif // GTEST_HAS_TYPED_TEST
// This #ifdef block tests type-parameterized tests.
@@ -266,6 +303,46 @@ REGISTER_TYPED_TEST_CASE_P(DerivedTest,
typedef Types<short, long> MyTwoTypes;
INSTANTIATE_TYPED_TEST_CASE_P(My, DerivedTest, MyTwoTypes);
+// Tests that custom names work with type parametrized tests. We reuse the
+// TwoTypes from above here.
+template <typename T>
+class TypeParametrizedTestWithNames : public Test {};
+
+TYPED_TEST_CASE_P(TypeParametrizedTestWithNames);
+
+TYPED_TEST_P(TypeParametrizedTestWithNames, TestCaseName) {
+ if (testing::internal::IsSame<TypeParam, char>::value) {
+ EXPECT_STREQ(::testing::UnitTest::GetInstance()
+ ->current_test_info()
+ ->test_case_name(),
+ "CustomName/TypeParametrizedTestWithNames/parChar0");
+ }
+ if (testing::internal::IsSame<TypeParam, int>::value) {
+ EXPECT_STREQ(::testing::UnitTest::GetInstance()
+ ->current_test_info()
+ ->test_case_name(),
+ "CustomName/TypeParametrizedTestWithNames/parInt1");
+ }
+}
+
+REGISTER_TYPED_TEST_CASE_P(TypeParametrizedTestWithNames, TestCaseName);
+
+class TypeParametrizedTestNames {
+ public:
+ template <typename T>
+ static std::string GetName(int i) {
+ if (testing::internal::IsSame<T, char>::value) {
+ return std::string("parChar") + ::testing::PrintToString(i);
+ }
+ if (testing::internal::IsSame<T, int>::value) {
+ return std::string("parInt") + ::testing::PrintToString(i);
+ }
+ }
+};
+
+INSTANTIATE_TYPED_TEST_CASE_P(CustomName, TypeParametrizedTestWithNames,
+ TwoTypes, TypeParametrizedTestNames);
+
// Tests that multiple TYPED_TEST_CASE_P's can be defined in the same
// translation unit.
@@ -377,4 +454,8 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, TrimmedTest, TrimTypes);
// must be defined). This dummy test keeps gtest_main linked in.
TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {}
+#if _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127
+#endif // _MSC_VER
+
#endif // #if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P)
diff --git a/googletest/test/gtest-typed-test_test.h b/googletest/test/gtest-typed-test_test.h
index 41d75704..2cce67c8 100644
--- a/googletest/test/gtest-typed-test_test.h
+++ b/googletest/test/gtest-typed-test_test.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
diff --git a/googletest/test/gtest-unittest-api_test.cc b/googletest/test/gtest-unittest-api_test.cc
index 1ebd431e..f3ea03a5 100644
--- a/googletest/test/gtest-unittest-api_test.cc
+++ b/googletest/test/gtest-unittest-api_test.cc
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
diff --git a/googletest/test/gtest_all_test.cc b/googletest/test/gtest_all_test.cc
index e6c1b018..e61e36b1 100644
--- a/googletest/test/gtest_all_test.cc
+++ b/googletest/test/gtest_all_test.cc
@@ -26,22 +26,21 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for Google C++ Testing and Mocking Framework (Google Test)
//
// Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose.
-#include "gtest-filepath_test.cc"
-#include "gtest-linked_ptr_test.cc"
-#include "gtest-message_test.cc"
-#include "gtest-options_test.cc"
-#include "gtest-port_test.cc"
-#include "gtest_pred_impl_unittest.cc"
-#include "gtest_prod_test.cc"
-#include "gtest-test-part_test.cc"
-#include "gtest-typed-test_test.cc"
-#include "gtest-typed-test2_test.cc"
-#include "gtest_unittest.cc"
-#include "production.cc"
+#include "test/googletest-filepath-test.cc"
+#include "test/googletest-linked-ptr-test.cc"
+#include "test/googletest-message-test.cc"
+#include "test/googletest-options-test.cc"
+#include "test/googletest-port-test.cc"
+#include "test/gtest_pred_impl_unittest.cc"
+#include "test/gtest_prod_test.cc"
+#include "test/googletest-test-part-test.cc"
+#include "test/gtest-typed-test_test.cc"
+#include "test/gtest-typed-test2_test.cc"
+#include "test/gtest_unittest.cc"
+#include "test/production.cc"
diff --git a/googletest/test/gtest_assert_by_exception_test.cc b/googletest/test/gtest_assert_by_exception_test.cc
index 2f0e34af..0eae8575 100644
--- a/googletest/test/gtest_assert_by_exception_test.cc
+++ b/googletest/test/gtest_assert_by_exception_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's assert-by-exception mode with exceptions enabled.
@@ -98,7 +97,7 @@ TEST(Test, Test) {
int kTestForContinuingTest = 0;
TEST(Test, Test2) {
- // FIXME(sokolov): how to force Test2 to be after Test?
+ // FIXME: how to force Test2 to be after Test?
kTestForContinuingTest = 1;
}
diff --git a/googletest/test/gtest_environment_test.cc b/googletest/test/gtest_environment_test.cc
index 1d6dc12b..bc9524d6 100644
--- a/googletest/test/gtest_environment_test.cc
+++ b/googletest/test/gtest_environment_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests using global test environments.
diff --git a/googletest/test/gtest_help_test.py b/googletest/test/gtest_help_test.py
index 79ffbe4e..582d24c2 100755
--- a/googletest/test/gtest_help_test.py
+++ b/googletest/test/gtest_help_test.py
@@ -37,8 +37,6 @@ SYNOPSIS
gtest_help_test.py
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import re
import gtest_test_utils
diff --git a/googletest/test/gtest_help_test_.cc b/googletest/test/gtest_help_test_.cc
index 31f78c24..750ae6ce 100644
--- a/googletest/test/gtest_help_test_.cc
+++ b/googletest/test/gtest_help_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// This program is meant to be run by gtest_help_test.py. Do not run
// it directly.
diff --git a/googletest/test/gtest_list_output_unittest.py b/googletest/test/gtest_list_output_unittest.py
new file mode 100644
index 00000000..3bba7ea2
--- /dev/null
+++ b/googletest/test/gtest_list_output_unittest.py
@@ -0,0 +1,141 @@
+#!/usr/bin/env python
+#
+# Copyright 2006, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"""Unit test for Google Test's --gtest_list_tests flag.
+
+A user can ask Google Test to list all tests by specifying the
+--gtest_list_tests flag. If output is requested, via --gtest_output=xml
+or --gtest_output=json, the tests are listed, with extra information in the
+output file.
+This script tests such functionality by invoking gtest_list_output_unittest_
+ (a program written with Google Test) the command line flags.
+"""
+
+import os
+import re
+import gtest_test_utils
+
+GTEST_LIST_TESTS_FLAG = '--gtest_list_tests'
+GTEST_OUTPUT_FLAG = '--gtest_output'
+
+EXPECTED_XML = """<\?xml version="1.0" encoding="UTF-8"\?>
+<testsuites tests="2" name="AllTests">
+ <testsuite name="FooTest" tests="2">
+ <testcase name="Test1" file=".*gtest_list_output_unittest_.cc" line="43" />
+ <testcase name="Test2" file=".*gtest_list_output_unittest_.cc" line="45" />
+ </testsuite>
+</testsuites>
+"""
+
+EXPECTED_JSON = """{
+ "tests": 2,
+ "name": "AllTests",
+ "testsuites": \[
+ {
+ "name": "FooTest",
+ "tests": 2,
+ "testsuite": \[
+ {
+ "name": "Test1",
+ "file": ".*gtest_list_output_unittest_.cc",
+ "line": 43
+ },
+ {
+ "name": "Test2",
+ "file": ".*gtest_list_output_unittest_.cc",
+ "line": 45
+ }
+ \]
+ }
+ \]
+}
+"""
+
+
+class GTestListTestsOutputUnitTest(gtest_test_utils.TestCase):
+ """Unit test for Google Test's list tests with output to file functionality.
+ """
+
+ def testXml(self):
+ """Verifies XML output for listing tests in a Google Test binary.
+
+ Runs a test program that generates an empty XML output, and
+ tests that the XML output is expected.
+ """
+ self._TestOutput('xml', EXPECTED_XML)
+
+ def testJSON(self):
+ """Verifies XML output for listing tests in a Google Test binary.
+
+ Runs a test program that generates an empty XML output, and
+ tests that the XML output is expected.
+ """
+ self._TestOutput('json', EXPECTED_JSON)
+
+ def _GetOutput(self, out_format):
+ file_path = os.path.join(gtest_test_utils.GetTempDir(),
+ 'test_out.' + out_format)
+ gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
+ 'gtest_list_output_unittest_')
+
+ command = ([
+ gtest_prog_path,
+ '%s=%s:%s' % (GTEST_OUTPUT_FLAG, out_format, file_path),
+ '--gtest_list_tests'
+ ])
+ environ_copy = os.environ.copy()
+ p = gtest_test_utils.Subprocess(
+ command, env=environ_copy, working_dir=gtest_test_utils.GetTempDir())
+
+ self.assert_(p.exited)
+ self.assertEquals(0, p.exit_code)
+ with open(file_path) as f:
+ result = f.read()
+ return result
+
+ def _TestOutput(self, test_format, expected_output):
+ actual = self._GetOutput(test_format)
+ actual_lines = actual.splitlines()
+ expected_lines = expected_output.splitlines()
+ line_count = 0
+ for actual_line in actual_lines:
+ expected_line = expected_lines[line_count]
+ expected_line_re = re.compile(expected_line.strip())
+ self.assert_(
+ expected_line_re.match(actual_line.strip()),
+ ('actual output of "%s",\n'
+ 'which does not match expected regex of "%s"\n'
+ 'on line %d' % (actual, expected_output, line_count)))
+ line_count = line_count + 1
+
+
+if __name__ == '__main__':
+ os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
+ gtest_test_utils.Main()
diff --git a/googletest/test/gtest_list_output_unittest_.cc b/googletest/test/gtest_list_output_unittest_.cc
new file mode 100644
index 00000000..b1c7b4de
--- /dev/null
+++ b/googletest/test/gtest_list_output_unittest_.cc
@@ -0,0 +1,51 @@
+// Copyright 2018, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Author: david.schuldenfrei@gmail.com (David Schuldenfrei)
+
+// Unit test for Google Test's --gtest_list_tests and --gtest_output flag.
+//
+// A user can ask Google Test to list all tests that will run,
+// and have the output saved in a Json/Xml file.
+// The tests will not be run after listing.
+//
+// This program will be invoked from a Python unit test.
+// Don't run it directly.
+
+#include "gtest/gtest.h"
+
+TEST(FooTest, Test1) {}
+
+TEST(FooTest, Test2) {}
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+
+ return RUN_ALL_TESTS();
+}
diff --git a/googletest/test/gtest_main_unittest.cc b/googletest/test/gtest_main_unittest.cc
index c979fce6..eddedeab 100644
--- a/googletest/test/gtest_main_unittest.cc
+++ b/googletest/test/gtest_main_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_no_test_unittest.cc b/googletest/test/gtest_no_test_unittest.cc
index 292599af..d4f88dbf 100644
--- a/googletest/test/gtest_no_test_unittest.cc
+++ b/googletest/test/gtest_no_test_unittest.cc
@@ -29,8 +29,6 @@
// Tests that a Google Test program that has no test defined can run
// successfully.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_premature_exit_test.cc b/googletest/test/gtest_premature_exit_test.cc
index 3b4dc7d4..c1e93056 100644
--- a/googletest/test/gtest_premature_exit_test.cc
+++ b/googletest/test/gtest_premature_exit_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests that Google Test manipulates the premature-exit-detection
// file correctly.
diff --git a/googletest/test/gtest_prod_test.cc b/googletest/test/gtest_prod_test.cc
index dfb99986..ede81a0d 100644
--- a/googletest/test/gtest_prod_test.cc
+++ b/googletest/test/gtest_prod_test.cc
@@ -26,10 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Unit test for gtest/gtest_prod.h.
+// Unit test for gtest_prod.h.
#include "production.h"
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_repeat_test.cc b/googletest/test/gtest_repeat_test.cc
index 31716043..1e8f499b 100644
--- a/googletest/test/gtest_repeat_test.cc
+++ b/googletest/test/gtest_repeat_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests the --gtest_repeat=number flag.
@@ -118,8 +117,7 @@ const int kNumberOfParamTests = 10;
class MyParamTest : public testing::TestWithParam<int> {};
TEST_P(MyParamTest, ShouldPass) {
- // TODO(vladl@google.com): Make parameter value checking robust
- // WRT order of tests.
+ // FIXME: Make parameter value checking robust WRT order of tests.
GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
g_param_test_count++;
}
diff --git a/googletest/test/gtest_sole_header_test.cc b/googletest/test/gtest_sole_header_test.cc
index ccd091a2..1d94ac6b 100644
--- a/googletest/test/gtest_sole_header_test.cc
+++ b/googletest/test/gtest_sole_header_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
+
//
// This test verifies that it's possible to use Google Test by including
// the gtest.h header file alone.
diff --git a/googletest/test/gtest_stress_test.cc b/googletest/test/gtest_stress_test.cc
index cac405f8..95ada39c 100644
--- a/googletest/test/gtest_stress_test.cc
+++ b/googletest/test/gtest_stress_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently.
diff --git a/googletest/test/gtest_test_macro_stack_footprint_test.cc b/googletest/test/gtest_test_macro_stack_footprint_test.cc
new file mode 100644
index 00000000..a48db050
--- /dev/null
+++ b/googletest/test/gtest_test_macro_stack_footprint_test.cc
@@ -0,0 +1,89 @@
+// Copyright 2013, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//
+// Each TEST() expands to some static registration logic. GCC puts all
+// such static initialization logic for a translation unit in a common,
+// internal function. Since Google's build system restricts how much
+// stack space a function can use, there's a limit on how many TEST()s
+// one can put in a single C++ test file. This test ensures that a large
+// number of TEST()s can be defined in the same translation unit.
+
+#include "gtest/gtest.h"
+
+// This macro defines 10 dummy tests.
+#define TEN_TESTS_(test_case_name) \
+ TEST(test_case_name, T0) {} \
+ TEST(test_case_name, T1) {} \
+ TEST(test_case_name, T2) {} \
+ TEST(test_case_name, T3) {} \
+ TEST(test_case_name, T4) {} \
+ TEST(test_case_name, T5) {} \
+ TEST(test_case_name, T6) {} \
+ TEST(test_case_name, T7) {} \
+ TEST(test_case_name, T8) {} \
+ TEST(test_case_name, T9) {}
+
+// This macro defines 100 dummy tests.
+#define HUNDRED_TESTS_(test_case_name_prefix) \
+ TEN_TESTS_(test_case_name_prefix ## 0) \
+ TEN_TESTS_(test_case_name_prefix ## 1) \
+ TEN_TESTS_(test_case_name_prefix ## 2) \
+ TEN_TESTS_(test_case_name_prefix ## 3) \
+ TEN_TESTS_(test_case_name_prefix ## 4) \
+ TEN_TESTS_(test_case_name_prefix ## 5) \
+ TEN_TESTS_(test_case_name_prefix ## 6) \
+ TEN_TESTS_(test_case_name_prefix ## 7) \
+ TEN_TESTS_(test_case_name_prefix ## 8) \
+ TEN_TESTS_(test_case_name_prefix ## 9)
+
+// This macro defines 1000 dummy tests.
+#define THOUSAND_TESTS_(test_case_name_prefix) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 0) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 1) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 2) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 3) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 4) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 5) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 6) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 7) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 8) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 9)
+
+// Ensures that we can define 1000 TEST()s in the same translation
+// unit.
+THOUSAND_TESTS_(T)
+
+int main(int argc, char **argv) {
+ testing::InitGoogleTest(&argc, argv);
+
+ // We don't actually need to run the dummy tests - the purpose is to
+ // ensure that they compile.
+ return 0;
+}
diff --git a/googletest/test/gtest_test_utils.py b/googletest/test/gtest_test_utils.py
index d7fc0990..43cba8f4 100755
--- a/googletest/test/gtest_test_utils.py
+++ b/googletest/test/gtest_test_utils.py
@@ -31,20 +31,16 @@
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import sys
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
import atexit
import shutil
import tempfile
-import unittest
-_test_module = unittest
+import unittest as _test_module
try:
import subprocess
@@ -74,7 +70,7 @@ def SetEnvVar(env_var, value):
# Here we expose a class from a particular module, depending on the
# environment. The comment suppresses the 'Invalid variable name' lint
# complaint.
-TestCase = _test_module.TestCase # pylint: disable-msg=C6409
+TestCase = _test_module.TestCase # pylint: disable=C6409
# Initially maps a flag to its default value. After
# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
@@ -88,7 +84,7 @@ def _ParseAndStripGTestFlags(argv):
# Suppresses the lint complaint about a global variable since we need it
# here to maintain module-wide state.
- global _gtest_flags_are_parsed # pylint: disable-msg=W0603
+ global _gtest_flags_are_parsed # pylint: disable=W0603
if _gtest_flags_are_parsed:
return
@@ -310,7 +306,7 @@ def Main():
_ParseAndStripGTestFlags(sys.argv)
# The tested binaries should not be writing XML output files unless the
# script explicitly instructs them to.
- # TODO(vladl@google.com): Move this into Subprocess when we implement
+ # FIXME: Move this into Subprocess when we implement
# passing environment into it as a parameter.
if GTEST_OUTPUT_VAR_NAME in os.environ:
del os.environ[GTEST_OUTPUT_VAR_NAME]
diff --git a/googletest/test/gtest_testbridge_test.py b/googletest/test/gtest_testbridge_test.py
index 2075e127..87ffad73 100644..100755
--- a/googletest/test/gtest_testbridge_test.py
+++ b/googletest/test/gtest_testbridge_test.py
@@ -29,8 +29,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Verifies that Google Test uses filter provided via testbridge."""
-__author__ = 'rfj@google.com (Rohan Joyce)'
-
import os
import gtest_test_utils
diff --git a/googletest/test/gtest_testbridge_test_.cc b/googletest/test/gtest_testbridge_test_.cc
index 0bb069e5..24617b20 100644
--- a/googletest/test/gtest_testbridge_test_.cc
+++ b/googletest/test/gtest_testbridge_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: rfj@google.com (Rohan Joyce)
+
// This program is meant to be run by gtest_test_filter_test.py. Do not run
// it directly.
diff --git a/googletest/test/gtest_throw_on_failure_ex_test.cc b/googletest/test/gtest_throw_on_failure_ex_test.cc
index 8d46c76f..93f59d49 100644
--- a/googletest/test/gtest_throw_on_failure_ex_test.cc
+++ b/googletest/test/gtest_throw_on_failure_ex_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's throw-on-failure mode with exceptions enabled.
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 39b68413..f7213fbf 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
@@ -35,8 +34,8 @@
#include "gtest/gtest.h"
// Verifies that the command line flag variables can be accessed in
-// code once "gtest/gtest.h" has been
-// #included. Do not move it after other gtest #includes.
+// code once "gtest.h" has been #included.
+// Do not move it after other gtest #includes.
TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
|| testing::GTEST_FLAG(break_on_failure)
@@ -444,10 +443,10 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test {
virtual void SetUp() {
saved_tz_ = NULL;
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* getenv, strdup: deprecated */)
+ GTEST_DISABLE_MSC_DEPRECATED_PUSH_(/* getenv, strdup: deprecated */)
if (getenv("TZ"))
saved_tz_ = strdup(getenv("TZ"));
- GTEST_DISABLE_MSC_WARNINGS_POP_()
+ GTEST_DISABLE_MSC_DEPRECATED_POP_()
// Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We
// cannot use the local time zone because the function's output depends
@@ -1385,8 +1384,7 @@ class TestResultTest : public Test {
// In order to test TestResult, we need to modify its internal
// state, in particular the TestPartResult vector it holds.
// test_part_results() returns a const reference to this vector.
- // We cast it to a non-const object s.t. it can be modified (yes,
- // this is a hack).
+ // We cast it to a non-const object s.t. it can be modified
TPRVector* results1 = const_cast<TPRVector*>(
&TestResultAccessor::test_part_results(*r1));
TPRVector* results2 = const_cast<TPRVector*>(
@@ -2092,8 +2090,8 @@ TEST_F(UnitTestRecordPropertyTest,
AddRecordWithReservedKeysGeneratesCorrectPropertyList) {
EXPECT_NONFATAL_FAILURE(
Test::RecordProperty("name", "1"),
- "'classname', 'name', 'status', 'time', 'type_param', and 'value_param'"
- " are reserved");
+ "'classname', 'name', 'status', 'time', 'type_param', 'value_param',"
+ " 'file', and 'line' are reserved");
}
class UnitTestRecordPropertyTestEnvironment : public Environment {
@@ -4689,7 +4687,7 @@ TEST(MacroTest, ADD_FAILURE_AT) {
// Unfortunately, we cannot verify that the failure message contains
// the right file path and line number the same way, as
// EXPECT_NONFATAL_FAILURE() doesn't get to see the file path and
- // line number. Instead, we do that in gtest_output_test_.cc.
+ // line number. Instead, we do that in googletest-output-test_.cc.
}
// Tests FAIL.
@@ -7373,7 +7371,7 @@ GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
// Tests for internal utilities necessary for implementation of the universal
// printing.
-// TODO(vladl@google.com): Find a better home for them.
+// FIXME: Find a better home for them.
class ConversionHelperBase {};
class ConversionHelperDerived : public ConversionHelperBase {};
diff --git a/googletest/test/gtest_xml_outfile1_test_.cc b/googletest/test/gtest_xml_outfile1_test_.cc
index e3d1dd1e..a38ebac8 100644
--- a/googletest/test/gtest_xml_outfile1_test_.cc
+++ b/googletest/test/gtest_xml_outfile1_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// gtest_xml_outfile1_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_outfile2_test_.cc b/googletest/test/gtest_xml_outfile2_test_.cc
index 55eb8f39..afaf15a5 100644
--- a/googletest/test/gtest_xml_outfile2_test_.cc
+++ b/googletest/test/gtest_xml_outfile2_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// gtest_xml_outfile2_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_outfiles_test.py b/googletest/test/gtest_xml_outfiles_test.py
index c7d34134..2c031ff8 100755
--- a/googletest/test/gtest_xml_outfiles_test.py
+++ b/googletest/test/gtest_xml_outfiles_test.py
@@ -111,11 +111,11 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
self.assert_(p.exited)
self.assertEquals(0, p.exit_code)
- # TODO(wan@google.com): libtool causes the built test binary to be
+ # FIXME: libtool causes the built test binary to be
# named lt-gtest_xml_outfiles_test_ instead of
# gtest_xml_outfiles_test_. To account for this possibility, we
# allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
+ # when libtool replacement tool is ready.
output_file_name1 = test_name + ".xml"
output_file1 = os.path.join(self.output_dir_, output_file_name1)
output_file_name2 = 'lt-' + output_file_name1
diff --git a/googletest/test/production.cc b/googletest/test/production.cc
index 006bb970..0f69f6db 100644
--- a/googletest/test/production.cc
+++ b/googletest/test/production.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// This is part of the unit test for gtest_prod.h.
diff --git a/googletest/test/production.h b/googletest/test/production.h
index 0f01d83e..542723b7 100644
--- a/googletest/test/production.h
+++ b/googletest/test/production.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// This is part of the unit test for gtest_prod.h.
diff --git a/googletest/xcode/Config/DebugProject.xcconfig b/googletest/xcode/Config/DebugProject.xcconfig
index 3d68157d..645701e2 100644
--- a/googletest/xcode/Config/DebugProject.xcconfig
+++ b/googletest/xcode/Config/DebugProject.xcconfig
@@ -5,7 +5,7 @@
// examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog.
// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
+// https://github.com/google/google-toolbox-for-mac
//
#include "General.xcconfig"
diff --git a/googletest/xcode/Config/FrameworkTarget.xcconfig b/googletest/xcode/Config/FrameworkTarget.xcconfig
index 357b1c8f..77081fbc 100644
--- a/googletest/xcode/Config/FrameworkTarget.xcconfig
+++ b/googletest/xcode/Config/FrameworkTarget.xcconfig
@@ -4,7 +4,7 @@
// These are Framework target settings for the gtest framework and examples. It
// is set in the "Based On:" dropdown in the "Target" info dialog.
// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
+// https://github.com/google/google-toolbox-for-mac
//
// Dynamic libs need to be position independent
diff --git a/googletest/xcode/Config/General.xcconfig b/googletest/xcode/Config/General.xcconfig
index f23e3222..1aba486f 100644
--- a/googletest/xcode/Config/General.xcconfig
+++ b/googletest/xcode/Config/General.xcconfig
@@ -4,7 +4,7 @@
// These are General configuration settings for the gtest framework and
// examples.
// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
+// https://github.com/google/google-toolbox-for-mac
//
// Build for PPC and Intel, 32- and 64-bit
diff --git a/googletest/xcode/Config/ReleaseProject.xcconfig b/googletest/xcode/Config/ReleaseProject.xcconfig
index 5349f0a0..df9a38f8 100644
--- a/googletest/xcode/Config/ReleaseProject.xcconfig
+++ b/googletest/xcode/Config/ReleaseProject.xcconfig
@@ -5,7 +5,7 @@
// and examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog.
// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
+// https://github.com/google/google-toolbox-for-mac
//
#include "General.xcconfig"
diff --git a/googletest/xcode/Config/StaticLibraryTarget.xcconfig b/googletest/xcode/Config/StaticLibraryTarget.xcconfig
index 3922fa51..d2424fe8 100644
--- a/googletest/xcode/Config/StaticLibraryTarget.xcconfig
+++ b/googletest/xcode/Config/StaticLibraryTarget.xcconfig
@@ -4,7 +4,7 @@
// These are static library target settings for libgtest.a. It
// is set in the "Based On:" dropdown in the "Target" info dialog.
// This file is based on the Xcode Configuration files in:
-// http://code.google.com/p/google-toolbox-for-mac/
+// https://github.com/google/google-toolbox-for-mac
//
// Static libs can be included in bundles so make them position independent