Merge branch 'master' into deprecate

This commit is contained in:
Gennadiy Civil 2018-08-03 12:05:07 -04:00 committed by GitHub
commit 61f949387e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 872 additions and 358 deletions

View File

@ -1,5 +1,5 @@
# Build matrix / environment variable are explained on: # 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: # This file can be validated on:
# http://lint.travis-ci.org/ # http://lint.travis-ci.org/

View File

@ -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 ## ## 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 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) { int main(int argc, char** argv) {
// The following line causes Google Mock to throw an exception on failure, // The following line causes Google Mock to throw an exception on failure,

View File

@ -528,7 +528,7 @@ interface, which then can be easily mocked. It's a bit of work
initially, but usually pays for itself quickly. initially, but usually pays for itself quickly.
This Google Testing Blog 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. 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! ## ## My mock object needs to do complex stuff. It's a lot of pain to specify the actions. Google Mock sucks! ##

View File

@ -242,7 +242,7 @@ class AbstractRpcServer(object):
The authentication process works as follows: The authentication process works as follows:
1) We get a username and password from the user 1) We get a username and password from the user
2) We use ClientLogin to obtain an AUTH token for 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 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 authentication cookie. If login was successful, it tries to redirect
us to the URL we provided. us to the URL we provided.
@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
(content_type, body) ready for httplib.HTTP instance. (content_type, body) ready for httplib.HTTP instance.
Source: 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-' BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
CRLF = '\r\n' CRLF = '\r\n'
@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
# svn cat translates keywords but svn diff doesn't. As a result of this # svn cat translates keywords but svn diff doesn't. As a result of this
# behavior patching.PatchChunks() fails with a chunk mismatch error. # behavior patching.PatchChunks() fails with a chunk mismatch error.
# This part was originally written by the Review Board development team # 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 # Mapping of keywords to known aliases
svn_keywords = { svn_keywords = {
# Standard keywords # Standard keywords
@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
status_lines = status.splitlines() status_lines = status.splitlines()
# If file is in a cl, the output will begin with # If file is in a cl, the output will begin with
# "\n--- Changelist 'cl_name':\n". See # "\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 if (len(status_lines) == 3 and
not status_lines[0] and not status_lines[0] and
status_lines[1].startswith("--- Changelist")): status_lines[1].startswith("--- Changelist")):

View File

@ -37,7 +37,7 @@
// causes a link error when _tmain is defined in a static library and UNICODE // 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 // 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: // 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 #if GTEST_OS_WINDOWS_MOBILE
# include <tchar.h> // NOLINT # include <tchar.h> // NOLINT

View File

@ -33,10 +33,8 @@
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
import gmock_test_utils import gmock_test_utils
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_') PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*'] TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']
TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*'] TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*']

View File

@ -43,7 +43,6 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import re import re
import sys import sys
import gmock_test_utils import gmock_test_utils

View File

@ -86,7 +86,7 @@ include_directories(
if (MSVC AND MSVC_VERSION EQUAL 1700) if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10) add_definitions(/D _VARIADIC_MAX=10)
endif() endif()
######################################################################## ########################################################################
# #
# Defines the gtest & gtest_main libraries. User tests should link # Defines the gtest & gtest_main libraries. User tests should link
@ -171,28 +171,28 @@ if (gtest_build_tests)
############################################################ ############################################################
# C++ tests built with standard compiler flags. # 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_environment_test gtest)
cxx_test(gtest-filepath_test gtest_main) cxx_test(googletest-filepath-test gtest_main)
cxx_test(gtest-linked_ptr_test gtest_main) cxx_test(googletest-linked-ptr-test gtest_main)
cxx_test(gtest-listener_test gtest_main) cxx_test(googletest-listener-test gtest_main)
cxx_test(gtest_main_unittest 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_no_test_unittest gtest)
cxx_test(gtest-options_test gtest_main) cxx_test(googletest-options-test gtest_main)
cxx_test(gtest-param-test_test gtest cxx_test(googletest-param-test-test gtest
test/gtest-param-test2_test.cc) test/googletest-param-test2-test.cc)
cxx_test(gtest-port_test gtest_main) cxx_test(googletest-port-test gtest_main)
cxx_test(gtest_pred_impl_unittest gtest_main) cxx_test(gtest_pred_impl_unittest gtest_main)
cxx_test(gtest_premature_exit_test gtest cxx_test(gtest_premature_exit_test gtest
test/gtest_premature_exit_test.cc) 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 cxx_test(gtest_prod_test gtest_main
test/production.cc) test/production.cc)
cxx_test(gtest_repeat_test gtest) cxx_test(gtest_repeat_test gtest)
cxx_test(gtest_sole_header_test gtest_main) cxx_test(gtest_sole_header_test gtest_main)
cxx_test(gtest_stress_test gtest) 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_throw_on_failure_ex_test gtest)
cxx_test(gtest-typed-test_test gtest_main cxx_test(gtest-typed-test_test gtest_main
test/gtest-typed-test2_test.cc) test/gtest-typed-test2_test.cc)
@ -214,10 +214,10 @@ if (gtest_build_tests)
cxx_test_with_flags(gtest-death-test_ex_nocatch_test cxx_test_with_flags(gtest-death-test_ex_nocatch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0" "${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_test_with_flags(gtest-death-test_ex_catch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1" "${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}" cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
gtest_main_no_rtti test/gtest_unittest.cc) gtest_main_no_rtti test/gtest_unittest.cc)
@ -238,75 +238,75 @@ if (gtest_build_tests)
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}" cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
src/gtest-all.cc src/gtest_main.cc) src/gtest-all.cc src/gtest_main.cc)
cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}" cxx_test_with_flags(googletest-tuple-test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple test/gtest-tuple_test.cc) gtest_main_use_own_tuple test/googletest-tuple-test.cc)
cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}" cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
gtest_main_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() endif()
############################################################ ############################################################
# Python tests. # Python tests.
cxx_executable(gtest_break_on_failure_unittest_ test gtest) cxx_executable(googletest-break-on-failure-unittest_ test gtest)
py_test(gtest_break_on_failure_unittest) py_test(googletest-break-on-failure-unittest)
# Visual Studio .NET 2003 does not support STL with exceptions disabled. # 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 if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
cxx_executable_with_flags( cxx_executable_with_flags(
gtest_catch_exceptions_no_ex_test_ googletest-catch-exceptions-no-ex-test_
"${cxx_no_exception}" "${cxx_no_exception}"
gtest_main_no_exception gtest_main_no_exception
test/gtest_catch_exceptions_test_.cc) test/googletest-catch-exceptions-test_.cc)
endif() endif()
cxx_executable_with_flags( cxx_executable_with_flags(
gtest_catch_exceptions_ex_test_ googletest-catch-exceptions-ex-test_
"${cxx_exception}" "${cxx_exception}"
gtest_main gtest_main
test/gtest_catch_exceptions_test_.cc) test/googletest-catch-exceptions-test_.cc)
py_test(gtest_catch_exceptions_test) py_test(googletest-catch-exceptions-test)
cxx_executable(gtest_color_test_ test gtest) cxx_executable(googletest-color-test_ test gtest)
py_test(gtest_color_test) py_test(googletest-color-test)
cxx_executable(gtest_env_var_test_ test gtest) cxx_executable(googletest-env-var-test_ test gtest)
py_test(gtest_env_var_test) py_test(googletest-env-var-test)
cxx_executable(gtest_filter_unittest_ test gtest) cxx_executable(googletest-filter-unittest_ test gtest)
py_test(gtest_filter_unittest) py_test(googletest-filter-unittest)
cxx_executable(gtest_help_test_ test gtest_main) cxx_executable(gtest_help_test_ test gtest_main)
py_test(gtest_help_test) py_test(gtest_help_test)
cxx_executable(gtest_list_tests_unittest_ test gtest) cxx_executable(googletest-list-tests-unittest_ test gtest)
py_test(gtest_list_tests_unittest) py_test(googletest-list-tests-unittest)
cxx_executable(gtest_output_test_ test gtest) cxx_executable(googletest-output-test_ test gtest)
py_test(gtest_output_test --no_stacktrace_support) py_test(googletest-output-test --no_stacktrace_support)
cxx_executable(gtest_shuffle_test_ test gtest) cxx_executable(googletest-shuffle-test_ test gtest)
py_test(gtest_shuffle_test) py_test(googletest-shuffle-test)
# MSVC 7.1 does not support STL with exceptions disabled. # MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310) if (NOT MSVC OR MSVC_VERSION GREATER 1310)
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception) cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception)
set_target_properties(gtest_throw_on_failure_test_ set_target_properties(googletest-throw-on-failure-test_
PROPERTIES PROPERTIES
COMPILE_FLAGS "${cxx_no_exception}") COMPILE_FLAGS "${cxx_no_exception}")
py_test(gtest_throw_on_failure_test) py_test(googletest-throw-on-failure-test)
endif() endif()
cxx_executable(gtest_uninitialized_test_ test gtest) cxx_executable(googletest-uninitialized-test_ test gtest)
py_test(gtest_uninitialized_test) py_test(googletest-uninitialized-test)
cxx_executable(gtest_xml_outfile1_test_ test gtest_main) cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
cxx_executable(gtest_xml_outfile2_test_ test gtest_main) cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
py_test(gtest_xml_outfiles_test) 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) cxx_executable(gtest_xml_output_unittest_ test gtest)
py_test(gtest_xml_output_unittest --no_stacktrace_support) 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() endif()

View File

@ -53,40 +53,40 @@ EXTRA_DIST += \
test/gtest-listener_test.cc \ test/gtest-listener_test.cc \
test/gtest-message_test.cc \ test/gtest-message_test.cc \
test/gtest-options_test.cc \ test/gtest-options_test.cc \
test/gtest-param-test2_test.cc \ test/googletest-param-test2-test.cc \
test/gtest-param-test2_test.cc \ test/googletest-param-test2-test.cc \
test/gtest-param-test_test.cc \ test/googletest-param-test-test.cc \
test/gtest-param-test_test.cc \ test/googletest-param-test-test.cc \
test/gtest-param-test_test.h \ test/gtest-param-test_test.h \
test/gtest-port_test.cc \ test/gtest-port_test.cc \
test/gtest_premature_exit_test.cc \ test/gtest_premature_exit_test.cc \
test/gtest-printers_test.cc \ test/gtest-printers_test.cc \
test/gtest-test-part_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-test2_test.cc \
test/gtest-typed-test_test.cc \ test/gtest-typed-test_test.cc \
test/gtest-typed-test_test.h \ test/gtest-typed-test_test.h \
test/gtest-unittest-api_test.cc \ test/gtest-unittest-api_test.cc \
test/gtest_break_on_failure_unittest_.cc \ test/googletest-break-on-failure-unittest_.cc \
test/gtest_catch_exceptions_test_.cc \ test/googletest-catch-exceptions-test_.cc \
test/gtest_color_test_.cc \ test/googletest-color-test_.cc \
test/gtest_env_var_test_.cc \ test/googletest-env-var-test_.cc \
test/gtest_environment_test.cc \ test/gtest_environment_test.cc \
test/gtest_filter_unittest_.cc \ test/googletest-filter-unittest_.cc \
test/gtest_help_test_.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_main_unittest.cc \
test/gtest_no_test_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_pred_impl_unittest.cc \
test/gtest_prod_test.cc \ test/gtest_prod_test.cc \
test/gtest_repeat_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_sole_header_test.cc \
test/gtest_stress_test.cc \ test/gtest_stress_test.cc \
test/gtest_throw_on_failure_ex_test.cc \ test/gtest_throw_on_failure_ex_test.cc \
test/gtest_throw_on_failure_test_.cc \ test/googletest-throw-on-failure-test_.cc \
test/gtest_uninitialized_test_.cc \ test/googletest-uninitialized-test_.cc \
test/gtest_unittest.cc \ test/gtest_unittest.cc \
test/gtest_unittest.cc \ test/gtest_unittest.cc \
test/gtest_xml_outfile1_test_.cc \ test/gtest_xml_outfile1_test_.cc \
@ -97,19 +97,19 @@ EXTRA_DIST += \
# Python tests that we don't run. # Python tests that we don't run.
EXTRA_DIST += \ EXTRA_DIST += \
test/gtest_break_on_failure_unittest.py \ test/googletest-break-on-failure-unittest.py \
test/gtest_catch_exceptions_test.py \ test/googletest-catch-exceptions-test.py \
test/gtest_color_test.py \ test/googletest-color-test.py \
test/gtest_env_var_test.py \ test/googletest-env-var-test.py \
test/gtest_filter_unittest.py \ test/googletest-filter-unittest.py \
test/gtest_help_test.py \ test/gtest_help_test.py \
test/gtest_list_tests_unittest.py \ test/googletest-list-tests-unittest.py \
test/gtest_output_test.py \ test/googletest-output-test.py \
test/gtest_output_test_golden_lin.txt \ test/googletest-output-test_golden_lin.txt \
test/gtest_shuffle_test.py \ test/googletest-shuffle-test.py \
test/gtest_test_utils.py \ test/gtest_test_utils.py \
test/gtest_throw_on_failure_test.py \ test/googletest-throw-on-failure-test.py \
test/gtest_uninitialized_test.py \ test/googletest-uninitialized-test.py \
test/gtest_xml_outfiles_test.py \ test/gtest_xml_outfiles_test.py \
test/gtest_xml_output_unittest.py \ test/gtest_xml_output_unittest.py \
test/gtest_xml_test_utils.py test/gtest_xml_test_utils.py

View File

@ -20,7 +20,7 @@ macro(fix_default_compiler_settings_)
if (MSVC) if (MSVC)
# For MSVC, CMake sets certain flags to defaults we want to override. # For MSVC, CMake sets certain flags to defaults we want to override.
# This replacement code is taken from sample in the CMake Wiki at # 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 foreach (flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)

View File

@ -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. 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. 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. 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". 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 # # 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 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. 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. 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 # # 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. 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.

View File

@ -154,7 +154,7 @@ c is 10
> `ASSERT_PRED*` or `EXPECT_PRED*`, please see > `ASSERT_PRED*` or `EXPECT_PRED*`, please see
> [this](faq#OverloadedPredicate) for how to resolve it. > [this](faq#OverloadedPredicate) for how to resolve it.
> 1. Currently we only provide predicate assertions of arity <= 5. If you need > 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. **Availability**: Linux, Windows, Mac.
@ -382,7 +382,7 @@ Verifies that `val1` is less than, or almost equal to, `val2`. You can replace
### Asserting Using gMock Matchers ### 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 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 *matcher* is basically a predicate that knows how to describe itself. It can be
used in these assertion macros: used in these assertion macros:
@ -402,17 +402,17 @@ using ::testing::StartsWith;
EXPECT_THAT(Foo(), StartsWith("Hello")); 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. the gMock Cookbook for more details.
gMock has a rich set of matchers. You can do many things googletest cannot do 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 alone with them. For a list of matchers gMock provides, read
[this](http://go/gmockguide#using-matchers). Especially useful among them are [this](../../googlemock/docs/CookBook.md#using-matchers). Especially useful among them are
some [protocol buffer matchers](http://go/protomatchers). It's easy to write 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](http://go/gmockguide#NewMatchers) too. your [own matchers](../../googlemock/docs/CookBook.md#writing-new-matchers-quickly) too.
For example, you can use gMock's 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: to compare protos in your tests:
```c++ ```c++
@ -433,7 +433,7 @@ and you're ready to go.
(Please read the [previous](#AssertThat) section first if you haven't.) (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 with `EXPECT_THAT()` or `ASSERT_THAT()` to do more string comparison tricks
(sub-string, prefix, suffix, regular expression, and etc). For example, (sub-string, prefix, suffix, regular expression, and etc). For example,

View File

@ -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 sub-processes, but not in the parent process. You can think of them as running
in a parallel universe, more or less. 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 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 occurred. Therefore, you may want to move your `EXPECT_CALL` statements inside
the `EXPECT_DEATH` macro. 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 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 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. or fake objects instead of real ones in your tests.
Sometimes this is impossible as some library you must use may be creating Sometimes this is impossible as some library you must use may be creating
@ -704,7 +704,7 @@ mistake in production. Such cleverness also leads to
advise against the practice, and googletest doesn't provide a way to do it. 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 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 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 production code doesn't link in the for-test logic at all (the
[`testonly`](http://go/testonly) attribute for BUILD targets helps to ensure [`testonly`](http://go/testonly) attribute for BUILD targets helps to ensure

View File

@ -5,8 +5,8 @@
*googletest* helps you write better C++ tests. *googletest* helps you write better C++ tests.
googletest is a testing framework developed by the [Testing googletest is a testing framework developed by the Testing
Technology](http://engdoc/eng/testing/TT/) team with Google's specific Technology team with Google's specific
requirements and constraints in mind. No matter whether you work on Linux, 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 Windows, or a Mac, if you write C++ code, googletest can help you. And it
supports *any* kind of tests, not just unit tests. supports *any* kind of tests, not just unit tests.
@ -75,7 +75,7 @@ the terms:
Meaning | googletest Term | [ISTQB](http://www.istqb.org/) Term 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) 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 ## Basic Concepts

View File

@ -397,7 +397,7 @@
#if GTEST_LANG_CXX11 #if GTEST_LANG_CXX11
# define GTEST_HAS_STD_TUPLE_ 1 # define GTEST_HAS_STD_TUPLE_ 1
# if defined(__clang__) # 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>) # if defined(__has_include) && !__has_include(<tuple>)
# undef GTEST_HAS_STD_TUPLE_ # undef GTEST_HAS_STD_TUPLE_
# endif # endif
@ -409,7 +409,7 @@
# elif defined(__GLIBCXX__) # elif defined(__GLIBCXX__)
// Inspired by boost/config/stdlib/libstdcpp3.hpp, // Inspired by boost/config/stdlib/libstdcpp3.hpp,
// http://gcc.gnu.org/gcc-4.2/changes.html and // 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) # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
# undef GTEST_HAS_STD_TUPLE_ # undef GTEST_HAS_STD_TUPLE_
# endif # endif
@ -1817,7 +1817,7 @@ class GTEST_API_ Mutex {
// Initializes owner_thread_id_ and critical_section_ in static mutexes. // Initializes owner_thread_id_ and critical_section_ in static mutexes.
void ThreadSafeLazyInit(); 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. // we assume that 0 is an invalid value for thread IDs.
unsigned int owner_thread_id_; unsigned int owner_thread_id_;

View File

@ -242,7 +242,7 @@ class AbstractRpcServer(object):
The authentication process works as follows: The authentication process works as follows:
1) We get a username and password from the user 1) We get a username and password from the user
2) We use ClientLogin to obtain an AUTH token for 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 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 authentication cookie. If login was successful, it tries to redirect
us to the URL we provided. us to the URL we provided.
@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
(content_type, body) ready for httplib.HTTP instance. (content_type, body) ready for httplib.HTTP instance.
Source: 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-' BOUNDARY = '-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
CRLF = '\r\n' CRLF = '\r\n'
@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
# svn cat translates keywords but svn diff doesn't. As a result of this # svn cat translates keywords but svn diff doesn't. As a result of this
# behavior patching.PatchChunks() fails with a chunk mismatch error. # behavior patching.PatchChunks() fails with a chunk mismatch error.
# This part was originally written by the Review Board development team # 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 # Mapping of keywords to known aliases
svn_keywords = { svn_keywords = {
# Standard keywords # Standard keywords
@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
status_lines = status.splitlines() status_lines = status.splitlines()
# If file is in a cl, the output will begin with # If file is in a cl, the output will begin with
# "\n--- Changelist 'cl_name':\n". See # "\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 if (len(status_lines) == 3 and
not status_lines[0] and not status_lines[0] and
status_lines[1].startswith("--- Changelist")): status_lines[1].startswith("--- Changelist")):

View File

@ -264,7 +264,7 @@ Mutex::~Mutex() {
// to clean them up. // to clean them up.
// TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
// nothing to clean it up but is available only on Vista and later. // 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) { if (type_ == kDynamic) {
::DeleteCriticalSection(critical_section_); ::DeleteCriticalSection(critical_section_);
delete critical_section_; delete critical_section_;

View File

@ -49,31 +49,48 @@ config_setting(
values = {"define": "absl=1"}, 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( cc_test(
name = "gtest_all_test", name = "gtest_all_test",
size = "small", size = "small",
srcs = glob( srcs = glob(
include = [ include = [
"gtest-*.cc", "gtest-*.cc",
"googletest-*.cc",
"*.h", "*.h",
"googletest/include/gtest/**/*.h", "googletest/include/gtest/**/*.h",
], ],
exclude = [ exclude = [
"gtest-unittest-api_test.cc", "gtest-unittest-api_test.cc",
"gtest-tuple_test.cc", "googletest-tuple-test.cc",
"googletest/src/gtest-all.cc", "googletest/src/gtest-all.cc",
"gtest_all_test.cc", "gtest_all_test.cc",
"gtest-death-test_ex_test.cc", "gtest-death-test_ex_test.cc",
"gtest-listener_test.cc", "gtest-listener_test.cc",
"gtest-unittest-api_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({ ) + select({
"//:windows": [], "//:windows": [],
"//:windows_msvc": [], "//:windows_msvc": [],
"//conditions:default": [ "//conditions:default": [
"gtest-tuple_test.cc", "googletest-tuple-test.cc",
], ],
}), }),
copts = select({ copts = select({
@ -97,16 +114,28 @@ cc_test(
deps = ["//:gtest_main"], 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() #These googletest tests have their own main()
cc_test( cc_test(
name = "gtest-listener_test", name = "googletest-listener-test",
size = "small", size = "small",
srcs = [ srcs = ["googletest-listener-test.cc"],
"gtest-listener_test.cc", deps = ["//:gtest_main"],
],
deps = [
"//:gtest",
],
) )
cc_test( cc_test(
@ -121,16 +150,14 @@ cc_test(
) )
cc_test( cc_test(
name = "gtest-param-test_test", name = "googletest-param-test-test",
size = "small", size = "small",
srcs = [ srcs = [
"gtest-param-test2_test.cc", "googletest-param-test-test.cc",
"gtest-param-test_test.cc", "googletest-param-test-test.h",
"gtest-param-test_test.h", "googletest-param-test2-test.cc",
],
deps = [
"//:gtest",
], ],
deps = ["//:gtest"],
) )
cc_test( cc_test(
@ -166,87 +193,92 @@ py_test(
) )
cc_binary( cc_binary(
name = "gtest_output_test_", name = "googletest-output-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_output_test_.cc"], srcs = ["googletest-output-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_output_test", name = "googletest-output-test",
size = "small", size = "small",
srcs = ["gtest_output_test.py"], srcs = ["googletest-output-test.py"],
args = select({ args = select({
":has_absl": [], ":has_absl": [],
"//conditions:default": ["--no_stacktrace_support"], "//conditions:default": ["--no_stacktrace_support"],
}), }),
data = [ data = [
"gtest_output_test_golden_lin.txt", "googletest-output-test-golden-lin.txt",
":gtest_output_test_", ":googletest-output-test_",
], ],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_color_test_", name = "googletest-color-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_color_test_.cc"], srcs = ["googletest-color-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_color_test", name = "googletest-color-test",
size = "small", size = "small",
srcs = ["gtest_color_test.py"], srcs = ["googletest-color-test.py"],
data = [":gtest_color_test_"], data = [":googletest-color-test_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_env_var_test_", name = "googletest-env-var-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_env_var_test_.cc"], srcs = ["googletest-env-var-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_env_var_test", name = "googletest-env-var-test",
size = "small", size = "medium",
srcs = ["gtest_env_var_test.py"], srcs = ["googletest-env-var-test.py"],
data = [":gtest_env_var_test_"], data = [":googletest-env-var-test_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_filter_unittest_", name = "googletest-filter-unittest_",
testonly = 1, testonly = 1,
srcs = ["gtest_filter_unittest_.cc"], srcs = ["googletest-filter-unittest_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_filter_unittest", name = "googletest-filter-unittest",
size = "small", size = "medium",
srcs = ["gtest_filter_unittest.py"], srcs = ["googletest-filter-unittest.py"],
data = [":gtest_filter_unittest_"], data = [":googletest-filter-unittest_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_break_on_failure_unittest_", name = "googletest-break-on-failure-unittest_",
testonly = 1, testonly = 1,
srcs = ["gtest_break_on_failure_unittest_.cc"], srcs = ["googletest-break-on-failure-unittest_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_break_on_failure_unittest", name = "googletest-break-on-failure-unittest",
size = "small", size = "small",
srcs = ["gtest_break_on_failure_unittest.py"], srcs = ["googletest-break-on-failure-unittest.py"],
data = [":gtest_break_on_failure_unittest_"], data = [":googletest-break-on-failure-unittest_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_test( cc_test(
name = "gtest_assert_by_exception_test", name = "gtest_assert_by_exception_test",
size = "small", size = "small",
@ -254,72 +286,75 @@ cc_test(
deps = ["//:gtest"], deps = ["//:gtest"],
) )
cc_binary( cc_binary(
name = "gtest_throw_on_failure_test_", name = "googletest-throw-on-failure-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_throw_on_failure_test_.cc"], srcs = ["googletest-throw-on-failure-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_throw_on_failure_test", name = "googletest-throw-on-failure-test",
size = "small", size = "small",
srcs = ["gtest_throw_on_failure_test.py"], srcs = ["googletest-throw-on-failure-test.py"],
data = [":gtest_throw_on_failure_test_"], data = [":googletest-throw-on-failure-test_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_list_tests_unittest_", name = "googletest-list-tests-unittest_",
testonly = 1, testonly = 1,
srcs = ["gtest_list_tests_unittest_.cc"], srcs = ["googletest-list-tests-unittest_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_list_tests_unittest", name = "googletest-list-tests-unittest",
size = "small", size = "small",
srcs = ["gtest_list_tests_unittest.py"], srcs = ["googletest-list-tests-unittest.py"],
data = [":gtest_list_tests_unittest_"], data = [":googletest-list-tests-unittest_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_shuffle_test_", name = "googletest-shuffle-test_",
srcs = ["gtest_shuffle_test_.cc"], srcs = ["googletest-shuffle-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_shuffle_test", name = "googletest-shuffle-test",
size = "small", size = "small",
srcs = ["gtest_shuffle_test.py"], srcs = ["googletest-shuffle-test.py"],
data = [":gtest_shuffle_test_"], data = [":googletest-shuffle-test_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
cc_binary( cc_binary(
name = "gtest_catch_exceptions_no_ex_test_", name = "googletest-catch-exceptions-no-ex-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_catch_exceptions_test_.cc"], srcs = ["googletest-catch-exceptions-test_.cc"],
deps = ["//:gtest_main"], deps = ["//:gtest_main"],
) )
cc_binary( cc_binary(
name = "gtest_catch_exceptions_ex_test_", name = "googletest-catch-exceptions-ex-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_catch_exceptions_test_.cc"], srcs = ["googletest-catch-exceptions-test_.cc"],
copts = ["-fexceptions"], copts = ["-fexceptions"],
deps = ["//:gtest_main"], deps = ["//:gtest_main"],
) )
py_test( py_test(
name = "gtest_catch_exceptions_test", name = "googletest-catch-exceptions-test",
size = "small", size = "small",
srcs = ["gtest_catch_exceptions_test.py"], srcs = ["googletest-catch-exceptions-test.py"],
data = [ data = [
":gtest_catch_exceptions_ex_test_", ":googletest-catch-exceptions-ex-test_",
":gtest_catch_exceptions_no_ex_test_", ":googletest-catch-exceptions-no-ex-test_",
], ],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
@ -387,17 +422,17 @@ py_test(
) )
cc_binary( cc_binary(
name = "gtest_uninitialized_test_", name = "googletest-uninitialized-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_uninitialized_test_.cc"], srcs = ["googletest-uninitialized-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_uninitialized_test", name = "googletest-uninitialized-test",
size = "medium", size = "medium",
srcs = ["gtest_uninitialized_test.py"], srcs = ["googletest-uninitialized-test.py"],
data = [":gtest_uninitialized_test_"], data = ["googletest-uninitialized-test_"],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
@ -416,3 +451,77 @@ py_test(
data = [":gtest_testbridge_test_"], data = [":gtest_testbridge_test_"],
deps = [":gtest_test_utils"], 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"],
)

View File

@ -34,7 +34,7 @@
A user can ask Google Test to seg-fault when an assertion fails, using A user can ask Google Test to seg-fault when an assertion fails, using
either the GTEST_BREAK_ON_FAILURE environment variable or the either the GTEST_BREAK_ON_FAILURE environment variable or the
--gtest_break_on_failure flag. This script tests such functionality --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. Google Test) with different environments and command line flags.
""" """
@ -59,9 +59,9 @@ THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
# The environment variable for enabling/disabling the catch-exceptions mode. # The environment variable for enabling/disabling the catch-exceptions mode.
CATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS' 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( EXE_PATH = gtest_test_utils.GetTestExecutablePath(
'gtest_break_on_failure_unittest_') 'googletest-break-on-failure-unittest_')
environ = gtest_test_utils.environ environ = gtest_test_utils.environ
@ -95,7 +95,7 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
""" """
def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault): 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. (or does not) have a seg-fault.
Args: Args:

View File

@ -30,8 +30,8 @@
"""Tests Google Test's exception catching behavior. """Tests Google Test's exception catching behavior.
This script invokes gtest_catch_exceptions_test_ and This script invokes googletest-catch-exceptions-test_ and
gtest_catch_exceptions_ex_test_ (programs written with googletest-catch-exceptions-ex-test_ (programs written with
Google Test) and verifies their output. Google Test) and verifies their output.
""" """
@ -45,15 +45,15 @@ LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0' NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
FILTER_FLAG = FLAG_PREFIX + 'filter' 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. # exceptions enabled.
EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath( 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. # exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath( EXE_PATH = gtest_test_utils.GetTestExecutablePath(
'gtest_catch_exceptions_no_ex_test_') 'googletest-catch-exceptions-no-ex-test_')
environ = gtest_test_utils.environ environ = gtest_test_utils.environ
SetEnvVar = gtest_test_utils.SetEnvVar SetEnvVar = gtest_test_utils.SetEnvVar

View File

@ -30,7 +30,7 @@
// Author: vladl@google.com (Vlad Losev) // Author: vladl@google.com (Vlad Losev)
// //
// Tests for Google Test itself. Tests in this file throw C++ or SEH // 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. // exceptions, and the output is verified by googletest-catch-exceptions-test.py.
#include "gtest/gtest.h" #include "gtest/gtest.h"

View File

@ -40,7 +40,7 @@ IS_WINDOWS = os.name == 'nt'
COLOR_ENV_VAR = 'GTEST_COLOR' COLOR_ENV_VAR = 'GTEST_COLOR'
COLOR_FLAG = '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): def SetEnvVar(env_var, value):
@ -53,7 +53,7 @@ def SetEnvVar(env_var, value):
def UsesColor(term, color_env_var, color_flag): 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('TERM', term)
SetEnvVar(COLOR_ENV_VAR, color_env_var) SetEnvVar(COLOR_ENV_VAR, color_env_var)

View File

@ -784,7 +784,7 @@ static void TestExitMacros() {
// Of all signals effects on the process exit code, only those of SIGABRT // Of all signals effects on the process exit code, only those of SIGABRT
// are documented on Windows. // 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"; EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
# elif !GTEST_OS_FUCHSIA # elif !GTEST_OS_FUCHSIA

View File

@ -69,7 +69,7 @@ TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
"exceptional message"); "exceptional message");
// Verifies that the location is mentioned in the failure text. // Verifies that the location is mentioned in the failure text.
EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""), EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
"gtest-death-test_ex_test.cc"); "googletest-death-test_ex_test.cc");
} }
# endif // GTEST_HAS_EXCEPTIONS # endif // GTEST_HAS_EXCEPTIONS

View File

@ -40,7 +40,7 @@ import gtest_test_utils
IS_WINDOWS = os.name == 'nt' IS_WINDOWS = os.name == 'nt'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' 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() environ = os.environ.copy()
@ -62,7 +62,7 @@ def SetEnvVar(env_var, value):
def GetFlag(flag): def GetFlag(flag):
"""Runs gtest_env_var_test_ and returns its output.""" """Runs googletest-env-var-test_ and returns its output."""
args = [COMMAND] args = [COMMAND]
if flag is not None: if flag is not None:

View File

@ -115,7 +115,7 @@ int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
if (argc != 2) { 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; return 1;
} }

View File

@ -33,7 +33,7 @@
A user can specify which test(s) in a Google Test program to run via either 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. the GTEST_FILTER environment variable or the --gtest_filter flag.
This script tests such functionality by invoking 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. environments and command line flags.
Note that test sharding may also influence which tests are filtered. Therefore, Note that test sharding may also influence which tests are filtered. Therefore,
@ -100,8 +100,8 @@ FILTER_FLAG = 'gtest_filter'
# The command line flag for including disabled tests. # The command line flag for including disabled tests.
ALSO_RUN_DISABLED_TESTS_FLAG = 'gtest_also_run_disabled_tests' ALSO_RUN_DISABLED_TESTS_FLAG = 'gtest_also_run_disabled_tests'
# Command to run the gtest_filter_unittest_ program. # Command to run the googletest-filter-unittest_ program.
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_filter_unittest_') COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-filter-unittest_')
# Regex for determining whether parameterized tests are enabled in the binary. # Regex for determining whether parameterized tests are enabled in the binary.
PARAM_TEST_REGEX = re.compile(r'/ParamTest') PARAM_TEST_REGEX = re.compile(r'/ParamTest')
@ -120,7 +120,7 @@ LIST_TESTS_FLAG = '--gtest_list_tests'
SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess( SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
[COMMAND, LIST_TESTS_FLAG]).output [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 = [ PARAM_TESTS = [
'SeqP/ParamTest.TestX/0', 'SeqP/ParamTest.TestX/0',
'SeqP/ParamTest.TestX/1', 'SeqP/ParamTest.TestX/1',
@ -292,7 +292,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
args=None, check_exit_0=False): args=None, check_exit_0=False):
"""Checks that binary runs correct tests for the given filter and shard. """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 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. on each shard should be identical to tests_to_run, without duplicates.
If check_exit_0, . If check_exit_0, .
@ -330,7 +330,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run): def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
"""Checks that the binary runs correct set of tests for the given filter. """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. disabled tests. Verifies that the right set of tests were run.
Args: Args:

View File

@ -46,7 +46,10 @@ GTEST_OUTPUT_FLAG = '--gtest_output'
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.json' GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.json'
GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_' 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: if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*' STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
@ -607,5 +610,9 @@ class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
if __name__ == '__main__': 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' os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
gtest_test_utils.Main() gtest_test_utils.Main()

View File

@ -33,7 +33,7 @@
A user can ask Google Test to list all tests by specifying the A user can ask Google Test to list all tests by specifying the
--gtest_list_tests flag. This script tests such functionality --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. Google Test) the command line flags.
""" """
@ -47,10 +47,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling listing all tests. # The command line flag for enabling/disabling listing all tests.
LIST_TESTS_FLAG = 'gtest_list_tests' LIST_TESTS_FLAG = 'gtest_list_tests'
# Path to the gtest_list_tests_unittest_ program. # Path to the googletest-list-tests-unittest_ program.
EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_list_tests_unittest_') 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 # --gtest_list_tests
EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\. EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\.
Test1 Test1
@ -94,7 +94,7 @@ MyInstantiation/ValueParamTest\.
TestB/2 # GetParam\(\) = a very\\nlo{241}\.\.\. 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*. # --gtest_list_tests and --gtest_filter=Foo*.
EXPECTED_OUTPUT_FILTER_FOO_RE = re.compile(r"""FooDeathTest\. EXPECTED_OUTPUT_FILTER_FOO_RE = re.compile(r"""FooDeathTest\.
Test1 Test1
@ -114,7 +114,7 @@ FooTest\.
def Run(args): 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, return gtest_test_utils.Subprocess([EXE_PATH] + args,
capture_stderr=False).output capture_stderr=False).output
@ -127,7 +127,7 @@ class GTestListTestsUnitTest(gtest_test_utils.TestCase):
"""Tests using the --gtest_list_tests flag to list all tests.""" """Tests using the --gtest_list_tests flag to list all tests."""
def RunAndVerify(self, flag_value, expected_output_re, other_flag): 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. the correct tests.
Args: Args:

View File

@ -99,7 +99,7 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
const std::string exe_str = GetCurrentExecutableName().string(); const std::string exe_str = GetCurrentExecutableName().string();
#if GTEST_OS_WINDOWS #if GTEST_OS_WINDOWS
const bool success = 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-options-ex_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_all_test", exe_str.c_str()) == 0 || _strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_dll_test", exe_str.c_str()) == 0; _strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
@ -109,7 +109,7 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
// TODO(wan@google.com): remove the hard-coded "lt-" prefix when // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
// Chandler Carruth's libtool replacement is ready. // Chandler Carruth's libtool replacement is ready.
const bool success = const bool success =
exe_str == "gtest-options_test" || exe_str == "googletest-options-test" ||
exe_str == "gtest_all_test" || exe_str == "gtest_all_test" ||
exe_str == "lt-gtest_all_test" || exe_str == "lt-gtest_all_test" ||
exe_str == "gtest_dll_test"; exe_str == "gtest_dll_test";

View File

@ -1,12 +1,12 @@
The non-test part of the code is expected to have 2 failures. 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 Value of: false
Actual: false Actual: false
Expected: true Expected: true
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
2 2
3 3
@ -38,7 +38,7 @@ BarEnvironment::SetUp() called.
[ OK ] PassingTest.PassingTest2 [ OK ] PassingTest.PassingTest2
[----------] 2 tests from NonfatalFailureTest [----------] 2 tests from NonfatalFailureTest
[ RUN ] NonfatalFailureTest.EscapesStringOperands [ RUN ] NonfatalFailureTest.EscapesStringOperands
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
kGoldenString kGoldenString
Which is: "\"Line" Which is: "\"Line"
@ -46,7 +46,7 @@ Expected equality of these values:
Which is: "actual \"string\"" Which is: "actual \"string\""
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
golden golden
Which is: "\"Line" Which is: "\"Line"
@ -56,7 +56,7 @@ Stack trace: (omitted)
[ FAILED ] NonfatalFailureTest.EscapesStringOperands [ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ RUN ] NonfatalFailureTest.DiffForLongStrings [ RUN ] NonfatalFailureTest.DiffForLongStrings
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
golden_str golden_str
Which is: "\"Line\0 1\"\nLine 2" Which is: "\"Line\0 1\"\nLine 2"
@ -72,7 +72,7 @@ Stack trace: (omitted)
[----------] 3 tests from FatalFailureTest [----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine [ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1) (expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
x x
@ -82,7 +82,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine [ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine [ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1) (expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
x x
@ -92,7 +92,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine [ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine [ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false) (expecting a failure on false)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Value of: false Value of: false
Actual: false Actual: false
Expected: true Expected: true
@ -104,45 +104,45 @@ Stack trace: (omitted)
(expecting 2 failures on (3) >= (a[i])) (expecting 2 failures on (3) >= (a[i]))
i == 0 i == 0
i == 1 i == 1
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9 Expected: (3) >= (a[i]), actual: 3 vs 9
Stack trace: (omitted) Stack trace: (omitted)
i == 2 i == 2
i == 3 i == 3
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6 Expected: (3) >= (a[i]), actual: 3 vs 6
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions [ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
[----------] 7 tests from SCOPED_TRACETest [----------] 7 tests from SCOPED_TRACETest
[ RUN ] SCOPED_TRACETest.AcceptedValues [ RUN ] SCOPED_TRACETest.AcceptedValues
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Just checking that all these values work fine. Just checking that all these values work fine.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: (null) googletest-output-test_.cc:#: (null)
gtest_output_test_.cc:#: 1337 googletest-output-test_.cc:#: 1337
gtest_output_test_.cc:#: std::string googletest-output-test_.cc:#: std::string
gtest_output_test_.cc:#: literal string googletest-output-test_.cc:#: literal string
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.AcceptedValues [ FAILED ] SCOPED_TRACETest.AcceptedValues
[ RUN ] SCOPED_TRACETest.ObeysScopes [ RUN ] SCOPED_TRACETest.ObeysScopes
(expected to fail) (expected to fail)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and shouldn't have a trace. This failure is expected, and shouldn't have a trace.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and should have a trace. This failure is expected, and should have a trace.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: Expected trace googletest-output-test_.cc:#: Expected trace
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and shouldn't have a trace. This failure is expected, and shouldn't have a trace.
Stack trace: (omitted) Stack trace: (omitted)
@ -150,131 +150,131 @@ Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.ObeysScopes [ FAILED ] SCOPED_TRACETest.ObeysScopes
[ RUN ] SCOPED_TRACETest.WorksInLoop [ RUN ] SCOPED_TRACETest.WorksInLoop
(expected to fail) (expected to fail)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
2 2
n n
Which is: 1 Which is: 1
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: i = 1 googletest-output-test_.cc:#: i = 1
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
n n
Which is: 2 Which is: 2
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: i = 2 googletest-output-test_.cc:#: i = 2
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksInLoop [ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine [ RUN ] SCOPED_TRACETest.WorksInSubroutine
(expected to fail) (expected to fail)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
2 2
n n
Which is: 1 Which is: 1
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: n = 1 googletest-output-test_.cc:#: n = 1
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
n n
Which is: 2 Which is: 2
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: n = 2 googletest-output-test_.cc:#: n = 2
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine [ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested [ RUN ] SCOPED_TRACETest.CanBeNested
(expected to fail) (expected to fail)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
n n
Which is: 2 Which is: 2
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: n = 2 googletest-output-test_.cc:#: n = 2
gtest_output_test_.cc:#: googletest-output-test_.cc:#:
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.CanBeNested [ FAILED ] SCOPED_TRACETest.CanBeNested
[ RUN ] SCOPED_TRACETest.CanBeRepeated [ RUN ] SCOPED_TRACETest.CanBeRepeated
(expected to fail) (expected to fail)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and should contain trace point A. This failure is expected, and should contain trace point A.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: A googletest-output-test_.cc:#: A
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and should contain trace point A and B. This failure is expected, and should contain trace point A and B.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: B googletest-output-test_.cc:#: B
gtest_output_test_.cc:#: A googletest-output-test_.cc:#: A
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and should contain trace point A, B, and C. This failure is expected, and should contain trace point A, B, and C.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: C googletest-output-test_.cc:#: C
gtest_output_test_.cc:#: B googletest-output-test_.cc:#: B
gtest_output_test_.cc:#: A googletest-output-test_.cc:#: A
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
This failure is expected, and should contain trace point A, B, and D. This failure is expected, and should contain trace point A, B, and D.
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: D googletest-output-test_.cc:#: D
gtest_output_test_.cc:#: B googletest-output-test_.cc:#: B
gtest_output_test_.cc:#: A googletest-output-test_.cc:#: A
Stack trace: (omitted) Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.CanBeRepeated [ FAILED ] SCOPED_TRACETest.CanBeRepeated
[ RUN ] SCOPED_TRACETest.WorksConcurrently [ RUN ] SCOPED_TRACETest.WorksConcurrently
(expecting 6 failures) (expecting 6 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #1 (in thread B, only trace B alive). Expected failure #1 (in thread B, only trace B alive).
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: Trace B googletest-output-test_.cc:#: Trace B
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #2 (in thread A, trace A & B both alive). Expected failure #2 (in thread A, trace A & B both alive).
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: Trace A googletest-output-test_.cc:#: Trace A
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #3 (in thread B, trace A & B both alive). Expected failure #3 (in thread B, trace A & B both alive).
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: Trace B googletest-output-test_.cc:#: Trace B
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #4 (in thread B, only trace A alive). Expected failure #4 (in thread B, only trace A alive).
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #5 (in thread A, only trace A alive). Expected failure #5 (in thread A, only trace A alive).
Google Test trace: Google Test trace:
gtest_output_test_.cc:#: Trace A googletest-output-test_.cc:#: Trace A
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #6 (in thread A, no trace alive). Expected failure #6 (in thread A, no trace alive).
Stack trace: (omitted) Stack trace: (omitted)
@ -282,7 +282,7 @@ Stack trace: (omitted)
[ FAILED ] SCOPED_TRACETest.WorksConcurrently [ FAILED ] SCOPED_TRACETest.WorksConcurrently
[----------] 1 test from ScopedTraceTest [----------] 1 test from ScopedTraceTest
[ RUN ] ScopedTraceTest.WithExplicitFileAndLine [ RUN ] ScopedTraceTest.WithExplicitFileAndLine
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Check that the trace is attached to a particular location. Check that the trace is attached to a particular location.
Google Test trace: Google Test trace:
@ -293,27 +293,27 @@ Stack trace: (omitted)
[----------] 1 test from NonFatalFailureInFixtureConstructorTest [----------] 1 test from NonFatalFailureInFixtureConstructorTest
[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor [ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 5 failures) (expecting 5 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #1, in the test fixture c'tor. Expected failure #1, in the test fixture c'tor.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #2, in SetUp(). Expected failure #2, in SetUp().
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #3, in the test body. Expected failure #3, in the test body.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #4, in TearDown. Expected failure #4, in TearDown.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #5, in the test fixture d'tor. Expected failure #5, in the test fixture d'tor.
Stack trace: (omitted) Stack trace: (omitted)
@ -322,12 +322,12 @@ Stack trace: (omitted)
[----------] 1 test from FatalFailureInFixtureConstructorTest [----------] 1 test from FatalFailureInFixtureConstructorTest
[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor [ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 2 failures) (expecting 2 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #1, in the test fixture c'tor. Expected failure #1, in the test fixture c'tor.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #2, in the test fixture d'tor. Expected failure #2, in the test fixture d'tor.
Stack trace: (omitted) Stack trace: (omitted)
@ -336,22 +336,22 @@ Stack trace: (omitted)
[----------] 1 test from NonFatalFailureInSetUpTest [----------] 1 test from NonFatalFailureInSetUpTest
[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp [ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
(expecting 4 failures) (expecting 4 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #1, in SetUp(). Expected failure #1, in SetUp().
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #2, in the test function. Expected failure #2, in the test function.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #3, in TearDown(). Expected failure #3, in TearDown().
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #4, in the test fixture d'tor. Expected failure #4, in the test fixture d'tor.
Stack trace: (omitted) Stack trace: (omitted)
@ -360,17 +360,17 @@ Stack trace: (omitted)
[----------] 1 test from FatalFailureInSetUpTest [----------] 1 test from FatalFailureInSetUpTest
[ RUN ] FatalFailureInSetUpTest.FailureInSetUp [ RUN ] FatalFailureInSetUpTest.FailureInSetUp
(expecting 3 failures) (expecting 3 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #1, in SetUp(). Expected failure #1, in SetUp().
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #2, in TearDown(). Expected failure #2, in TearDown().
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected failure #3, in the test fixture d'tor. Expected failure #3, in the test fixture d'tor.
Stack trace: (omitted) Stack trace: (omitted)
@ -483,13 +483,13 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: 2 failures Actual: 2 failures
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure 1. Expected non-fatal failure 1.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure 2. Expected non-fatal failure 2.
Stack trace: (omitted) Stack trace: (omitted)
@ -503,7 +503,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -548,13 +548,13 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: 2 failures Actual: 2 failures
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -568,7 +568,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -597,7 +597,7 @@ Stack trace: (omitted)
[ RUN ] TypedTest/0.Success [ RUN ] TypedTest/0.Success
[ OK ] TypedTest/0.Success [ OK ] TypedTest/0.Success
[ RUN ] TypedTest/0.Failure [ RUN ] TypedTest/0.Failure
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
TypeParam() TypeParam()
@ -610,7 +610,7 @@ Stack trace: (omitted)
[ RUN ] Unsigned/TypedTestP/0.Success [ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success [ OK ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Failure [ RUN ] Unsigned/TypedTestP/0.Failure
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1U 1U
Which is: 1 Which is: 1
@ -624,7 +624,7 @@ Stack trace: (omitted)
[ RUN ] Unsigned/TypedTestP/1.Success [ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success [ OK ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Failure [ RUN ] Unsigned/TypedTestP/1.Failure
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1U 1U
Which is: 1 Which is: 1
@ -640,7 +640,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Success: googletest-output-test_.cc:#: Success:
Succeeded Succeeded
Stack trace: (omitted) Stack trace: (omitted)
@ -651,7 +651,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -663,7 +663,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected." Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual: Actual:
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -677,7 +677,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Success: googletest-output-test_.cc:#: Success:
Succeeded Succeeded
Stack trace: (omitted) Stack trace: (omitted)
@ -688,7 +688,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -700,7 +700,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure." Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual: Actual:
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -714,7 +714,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Success: googletest-output-test_.cc:#: Success:
Succeeded Succeeded
Stack trace: (omitted) Stack trace: (omitted)
@ -725,7 +725,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure Expected: 1 fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -737,7 +737,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected." Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual: Actual:
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -751,7 +751,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Success: googletest-output-test_.cc:#: Success:
Succeeded Succeeded
Stack trace: (omitted) Stack trace: (omitted)
@ -762,7 +762,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure Expected: 1 non-fatal failure
Actual: Actual:
gtest_output_test_.cc:#: Fatal failure: googletest-output-test_.cc:#: Fatal failure:
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -774,7 +774,7 @@ Stack trace: (omitted)
gtest.cc:#: Failure gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure." Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual: Actual:
gtest_output_test_.cc:#: Non-fatal failure: googletest-output-test_.cc:#: Non-fatal failure:
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -786,7 +786,7 @@ Stack trace: (omitted)
[----------] 2 tests from ExpectFailureWithThreadsTest [----------] 2 tests from ExpectFailureWithThreadsTest
[ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure [ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure
(expecting 2 failures) (expecting 2 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -799,7 +799,7 @@ Stack trace: (omitted)
[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure [ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
[ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure [ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
(expecting 2 failures) (expecting 2 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -813,12 +813,12 @@ Stack trace: (omitted)
[----------] 1 test from ScopedFakeTestPartResultReporterTest [----------] 1 test from ScopedFakeTestPartResultReporterTest
[ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread [ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
(expecting 2 failures) (expecting 2 failures)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -826,7 +826,7 @@ Stack trace: (omitted)
[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread [ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[----------] 1 test from PrintingFailingParams/FailingParamTest [----------] 1 test from PrintingFailingParams/FailingParamTest
[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0 [ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
GetParam() GetParam()
@ -838,7 +838,7 @@ Stack trace: (omitted)
[ RUN ] PrintingStrings/ParamTest.Success/a [ RUN ] PrintingStrings/ParamTest.Success/a
[ OK ] PrintingStrings/ParamTest.Success/a [ OK ] PrintingStrings/ParamTest.Success/a
[ RUN ] PrintingStrings/ParamTest.Failure/a [ RUN ] PrintingStrings/ParamTest.Failure/a
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
"b" "b"
GetParam() GetParam()
@ -849,13 +849,13 @@ Stack trace: (omitted)
[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a" [ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
[----------] Global test environment tear-down [----------] Global test environment tear-down
BarEnvironment::TearDown() called. BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected non-fatal failure. Expected non-fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
FooEnvironment::TearDown() called. FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Failed Failed
Expected fatal failure. Expected fatal failure.
Stack trace: (omitted) Stack trace: (omitted)
@ -919,7 +919,7 @@ Stack trace: (omitted)
[----------] 3 tests from FatalFailureTest [----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine [ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1) (expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
x x
@ -929,7 +929,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms) [ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine [ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1) (expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected equality of these values: Expected equality of these values:
1 1
x x
@ -939,7 +939,7 @@ Stack trace: (omitted)
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms) [ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine [ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false) (expecting a failure on false)
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Value of: false Value of: false
Actual: false Actual: false
Expected: true Expected: true
@ -953,13 +953,13 @@ Stack trace: (omitted)
(expecting 2 failures on (3) >= (a[i])) (expecting 2 failures on (3) >= (a[i]))
i == 0 i == 0
i == 1 i == 1
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9 Expected: (3) >= (a[i]), actual: 3 vs 9
Stack trace: (omitted) Stack trace: (omitted)
i == 2 i == 2
i == 3 i == 3
gtest_output_test_.cc:#: Failure googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6 Expected: (3) >= (a[i]), actual: 3 vs 6
Stack trace: (omitted) Stack trace: (omitted)

View File

@ -33,10 +33,10 @@
SYNOPSIS SYNOPSIS
gtest_output_test.py --build_dir=BUILD/DIR --gengolden googletest_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest_output_test_ file. # where BUILD/DIR contains the built googletest-output-test_ file.
gtest_output_test.py --gengolden googletest_output_test.py --gengolden
gtest_output_test.py googletest_output_test.py
""" """
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
@ -59,9 +59,9 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt' IS_WINDOWS = os.name == 'nt'
# TODO(vladl@google.com): remove the _lin suffix. # TODO(vladl@google.com): remove the _lin suffix.
GOLDEN_NAME = 'gtest_output_test_golden_lin.txt' 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 # At least one command we exercise must not have the
# 'internal_skip_environment_and_ad_hoc_tests' argument. # 'internal_skip_environment_and_ad_hoc_tests' argument.
@ -104,7 +104,7 @@ def RemoveLocations(test_output):
'FILE_NAME:#: '. '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) r'\1:#: ', test_output)
@ -195,7 +195,7 @@ def RemoveMatchingTests(test_output, pattern):
def NormalizeOutput(output): 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 = ToUnixLineEnding(output)
output = RemoveLocations(output) output = RemoveLocations(output)
@ -316,11 +316,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
if os.getenv('DEBUG_GTEST_OUTPUT_TEST'): if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
open(os.path.join( open(os.path.join(
gtest_test_utils.GetSourceDir(), gtest_test_utils.GetSourceDir(),
'_gtest_output_test_normalized_actual.txt'), 'wb').write( '_googletest-output-test_normalized_actual.txt'), 'wb').write(
normalized_actual) normalized_actual)
open(os.path.join( open(os.path.join(
gtest_test_utils.GetSourceDir(), gtest_test_utils.GetSourceDir(),
'_gtest_output_test_normalized_golden.txt'), 'wb').write( '_googletest-output-test_normalized_golden.txt'), 'wb').write(
normalized_golden) normalized_golden)
self.assertEqual(normalized_golden, normalized_actual) self.assertEqual(normalized_golden, normalized_actual)

View File

@ -29,7 +29,7 @@
// //
// The purpose of this file is to generate Google Test output under // The purpose of this file is to generate Google Test output under
// various conditions. The output will then be verified by // 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 // desired messages. Therefore, most tests in this file are MEANT TO
// FAIL. // FAIL.
// //

View File

@ -0,0 +1,72 @@
#!/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."""
__author__ = 'jmadill@google.com (Jamie Madill)'
import os
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
if IS_LINUX:
import gtest_test_utils
else:
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()

View File

@ -0,0 +1,51 @@
// 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.
//
// Author: jmadill@google.com (Jamie Madill)
#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();
}

View File

@ -0,0 +1,71 @@
#!/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."""
__author__ = 'jmadill@google.com (Jamie Madill)'
import os
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
if IS_LINUX:
import gtest_test_utils
else:
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()

View File

@ -0,0 +1,56 @@
// 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.
//
// Author: jmadill@google.com (Jamie Madill)
#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();
}

View File

@ -43,7 +43,7 @@
# include <vector> # include <vector>
# include "src/gtest-internal-inl.h" // for UnitTestOptions # 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::vector;
using ::std::sort; using ::std::sort;

View File

@ -33,18 +33,18 @@
// Google Test work. // Google Test work.
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "gtest-param-test_test.h" #include "googletest-param-test-test.h"
using ::testing::Values; using ::testing::Values;
using ::testing::internal::ParamGenerator; using ::testing::internal::ParamGenerator;
// Tests that generators defined in a different translation unit // Tests that generators defined in a different translation unit
// are functional. The test using extern_gen is defined // 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); ParamGenerator<int> extern_gen = Values(33);
// Tests that a parameterized test case can be defined in one translation unit // 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 instantiated in another. The test is defined in googletest-param-test-test.cc
// and ExternalInstantiationTest fixture class is defined in // and ExternalInstantiationTest fixture class is defined in
// gtest-param-test_test.h. // gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P(MultiplesOf33, INSTANTIATE_TEST_CASE_P(MultiplesOf33,
@ -53,7 +53,7 @@ INSTANTIATE_TEST_CASE_P(MultiplesOf33,
// Tests that a parameterized test case can be instantiated // Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined // in multiple translation units. Another instantiation is defined
// in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest // in googletest-param-test-test.cc and InstantiationInMultipleTranslaionUnitsTest
// fixture is defined in gtest-param-test_test.h // fixture is defined in gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P(Sequence2, INSTANTIATE_TEST_CASE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest, InstantiationInMultipleTranslaionUnitsTest,

View File

@ -346,11 +346,11 @@ TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const bool a_false_condition = false; const bool a_false_condition = false;
const char regex[] = const char regex[] =
#ifdef _MSC_VER #ifdef _MSC_VER
"gtest-port_test\\.cc\\(\\d+\\):" "googletest-port-test\\.cc\\(\\d+\\):"
#elif GTEST_USES_POSIX_RE #elif GTEST_USES_POSIX_RE
"gtest-port_test\\.cc:[0-9]+" "googletest-port-test\\.cc:[0-9]+"
#else #else
"gtest-port_test\\.cc:\\d+" "googletest-port-test\\.cc:\\d+"
#endif // _MSC_VER #endif // _MSC_VER
".*a_false_condition.*Extra info.*"; ".*a_false_condition.*Extra info.*";

View File

@ -35,8 +35,8 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import gtest_test_utils import gtest_test_utils
# Command to run the gtest_shuffle_test_ program. # Command to run the googletest-shuffle-test_ program.
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_shuffle_test_') COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-shuffle-test_')
# The environment variables for test sharding. # The environment variables for test sharding.
TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS' TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
@ -89,7 +89,7 @@ def GetTestsForAllIterations(extra_env, args):
Args: Args:
extra_env: a map from environment variables to their values 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: Returns:
A list where the i-th element is the list of tests run in the i-th A list where the i-th element is the list of tests run in the i-th

View File

@ -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.
//
// 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 "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));

View File

@ -31,7 +31,7 @@
"""Tests Google Test's throw-on-failure mode with exceptions disabled. """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. Google Test) with different environments and command line flags.
""" """
@ -46,10 +46,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling the throw-on-failure mode. # The command line flag for enabling/disabling the throw-on-failure mode.
THROW_ON_FAILURE = 'gtest_throw_on_failure' 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. # exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath( EXE_PATH = gtest_test_utils.GetTestExecutablePath(
'gtest_throw_on_failure_test_') 'googletest-throw-on-failure-test_')
# Utilities. # Utilities.
@ -76,12 +76,12 @@ def Run(command):
# The tests. TODO(wan@google.com): refactor the class to share common # The tests. TODO(wan@google.com): refactor the class to share common
# logic with code in gtest_break_on_failure_unittest.py. # logic with code in googletest-break-on-failure-unittest.py.
class ThrowOnFailureTest(gtest_test_utils.TestCase): class ThrowOnFailureTest(gtest_test_utils.TestCase):
"""Tests the throw-on-failure mode.""" """Tests the throw-on-failure mode."""
def RunAndVerify(self, env_var_value, flag_value, should_fail): 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. (or does not) exit with a non-zero code.
Args: Args:

View File

@ -32,7 +32,7 @@
// Tests Google Test's throw-on-failure mode with exceptions disabled. // Tests Google Test's throw-on-failure mode with exceptions disabled.
// //
// This program must be compiled with exceptions disabled. It will be // 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. // with non-zero in the throw-on-failure mode or 0 otherwise.
#include "gtest/gtest.h" #include "gtest/gtest.h"

View File

@ -35,7 +35,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import gtest_test_utils import gtest_test_utils
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_') COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_')
def Assert(condition): def Assert(condition):

View File

@ -33,14 +33,14 @@
// //
// Sometimes it's desirable to build most of Google Test's own tests // Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose. // by compiling a single file. This file serves this purpose.
#include "gtest-filepath_test.cc" #include "googletest-filepath-test.cc"
#include "gtest-linked_ptr_test.cc" #include "googletest-linked-ptr-test.cc"
#include "gtest-message_test.cc" #include "googletest-message-test.cc"
#include "gtest-options_test.cc" #include "googletest-options-test.cc"
#include "gtest-port_test.cc" #include "googletest-port-test.cc"
#include "gtest_pred_impl_unittest.cc" #include "gtest_pred_impl_unittest.cc"
#include "gtest_prod_test.cc" #include "gtest_prod_test.cc"
#include "gtest-test-part_test.cc" #include "googletest-test-part-test.cc"
#include "gtest-typed-test_test.cc" #include "gtest-typed-test_test.cc"
#include "gtest-typed-test2_test.cc" #include "gtest-typed-test2_test.cc"
#include "gtest_unittest.cc" #include "gtest_unittest.cc"

View File

@ -0,0 +1,90 @@
// 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.
//
// Author: wan@google.com (Zhanyong Wan)
//
// 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;
}

View File

@ -4689,7 +4689,7 @@ TEST(MacroTest, ADD_FAILURE_AT) {
// Unfortunately, we cannot verify that the failure message contains // Unfortunately, we cannot verify that the failure message contains
// the right file path and line number the same way, as // the right file path and line number the same way, as
// EXPECT_NONFATAL_FAILURE() doesn't get to see the file path and // 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. // Tests FAIL.

View File

@ -5,7 +5,7 @@
// examples. It is set in the "Based On:" dropdown in the "Project" info // examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog. // dialog.
// This file is based on the Xcode Configuration files in: // 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" #include "General.xcconfig"

View File

@ -4,7 +4,7 @@
// These are Framework target settings for the gtest framework and examples. It // These are Framework target settings for the gtest framework and examples. It
// is set in the "Based On:" dropdown in the "Target" info dialog. // is set in the "Based On:" dropdown in the "Target" info dialog.
// This file is based on the Xcode Configuration files in: // 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 // Dynamic libs need to be position independent

View File

@ -4,7 +4,7 @@
// These are General configuration settings for the gtest framework and // These are General configuration settings for the gtest framework and
// examples. // examples.
// This file is based on the Xcode Configuration files in: // 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 // Build for PPC and Intel, 32- and 64-bit

View File

@ -5,7 +5,7 @@
// and examples. It is set in the "Based On:" dropdown in the "Project" info // and examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog. // dialog.
// This file is based on the Xcode Configuration files in: // 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" #include "General.xcconfig"

View File

@ -4,7 +4,7 @@
// These are static library target settings for libgtest.a. It // These are static library target settings for libgtest.a. It
// is set in the "Based On:" dropdown in the "Target" info dialog. // is set in the "Based On:" dropdown in the "Target" info dialog.
// This file is based on the Xcode Configuration files in: // 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 // Static libs can be included in bundles so make them position independent