summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/BUILD.bazel315
-rwxr-xr-xgoogletest/test/googletest-break-on-failure-unittest.py (renamed from googletest/test/gtest_break_on_failure_unittest.py)10
-rw-r--r--googletest/test/googletest-break-on-failure-unittest_.cc (renamed from googletest/test/gtest_break_on_failure_unittest_.cc)3
-rwxr-xr-xgoogletest/test/googletest-catch-exceptions-test.py (renamed from googletest/test/gtest_catch_exceptions_test.py)14
-rw-r--r--googletest/test/googletest-catch-exceptions-test_.cc (renamed from googletest/test/gtest_catch_exceptions_test_.cc)10
-rwxr-xr-xgoogletest/test/googletest-color-test.py (renamed from googletest/test/gtest_color_test.py)6
-rw-r--r--googletest/test/googletest-color-test_.cc (renamed from googletest/test/gtest_color_test_.cc)3
-rw-r--r--googletest/test/googletest-death-test-test.cc (renamed from googletest/test/gtest-death-test_test.cc)7
-rw-r--r--googletest/test/googletest-death-test_ex_test.cc (renamed from googletest/test/gtest-death-test_ex_test.cc)5
-rwxr-xr-xgoogletest/test/googletest-env-var-test.py (renamed from googletest/test/gtest_env_var_test.py)6
-rw-r--r--googletest/test/googletest-env-var-test_.cc (renamed from googletest/test/gtest_env_var_test_.cc)8
-rw-r--r--googletest/test/googletest-filepath-test.cc (renamed from googletest/test/gtest-filepath_test.cc)3
-rwxr-xr-xgoogletest/test/googletest-filter-unittest.py (renamed from googletest/test/gtest_filter_unittest.py)14
-rw-r--r--googletest/test/googletest-filter-unittest_.cc (renamed from googletest/test/gtest_filter_unittest_.cc)3
-rw-r--r--googletest/test/googletest-json-outfiles-test.py (renamed from googletest/test/gtest_json_outfiles_test.py)4
-rw-r--r--googletest/test/googletest-json-output-unittest.py (renamed from googletest/test/gtest_json_output_unittest.py)9
-rw-r--r--googletest/test/googletest-linked-ptr-test.cc (renamed from googletest/test/gtest-linked_ptr_test.cc)7
-rwxr-xr-xgoogletest/test/googletest-list-tests-unittest.py (renamed from googletest/test/gtest_list_tests_unittest.py)16
-rw-r--r--googletest/test/googletest-list-tests-unittest_.cc (renamed from googletest/test/gtest_list_tests_unittest_.cc)3
-rw-r--r--googletest/test/googletest-listener-test.cc (renamed from googletest/test/gtest-listener_test.cc)6
-rw-r--r--googletest/test/googletest-message-test.cc (renamed from googletest/test/gtest-message_test.cc)3
-rw-r--r--googletest/test/googletest-options-test.cc (renamed from googletest/test/gtest-options_test.cc)8
-rw-r--r--googletest/test/googletest-output-test-golden-lin.txt (renamed from googletest/test/gtest_output_test_golden_lin.txt)426
-rwxr-xr-xgoogletest/test/googletest-output-test.py (renamed from googletest/test/gtest_output_test.py)41
-rw-r--r--googletest/test/googletest-output-test_.cc (renamed from googletest/test/gtest_output_test_.cc)4
-rw-r--r--googletest/test/googletest-param-test-invalid-name1-test.py63
-rw-r--r--googletest/test/googletest-param-test-invalid-name1-test_.cc50
-rw-r--r--googletest/test/googletest-param-test-invalid-name2-test.py62
-rw-r--r--googletest/test/googletest-param-test-invalid-name2-test_.cc55
-rw-r--r--googletest/test/googletest-param-test-test.cc (renamed from googletest/test/gtest-param-test_test.cc)7
-rw-r--r--googletest/test/googletest-param-test-test.h (renamed from googletest/test/gtest-param-test_test.h)2
-rw-r--r--googletest/test/googletest-param-test2-test.cc (renamed from googletest/test/gtest-param-test2_test.cc)18
-rw-r--r--googletest/test/googletest-port-test.cc (renamed from googletest/test/gtest-port_test.cc)13
-rw-r--r--googletest/test/googletest-printers-test.cc (renamed from googletest/test/gtest-printers_test.cc)27
-rwxr-xr-xgoogletest/test/googletest-shuffle-test.py (renamed from googletest/test/gtest_shuffle_test.py)8
-rw-r--r--googletest/test/googletest-shuffle-test_.cc (renamed from googletest/test/gtest_shuffle_test_.cc)3
-rw-r--r--googletest/test/googletest-test-part-test.cc (renamed from googletest/test/gtest-test-part_test.cc)5
-rw-r--r--googletest/test/googletest-test2_test.cc61
-rwxr-xr-xgoogletest/test/googletest-throw-on-failure-test.py (renamed from googletest/test/gtest_throw_on_failure_test.py)14
-rw-r--r--googletest/test/googletest-throw-on-failure-test_.cc (renamed from googletest/test/gtest_throw_on_failure_test_.cc)5
-rw-r--r--googletest/test/googletest-tuple-test.cc (renamed from googletest/test/gtest-tuple_test.cc)3
-rwxr-xr-xgoogletest/test/googletest-uninitialized-test.py (renamed from googletest/test/gtest_uninitialized_test.py)4
-rw-r--r--googletest/test/googletest-uninitialized-test_.cc (renamed from googletest/test/gtest_uninitialized_test_.cc)3
-rw-r--r--googletest/test/gtest-typed-test2_test.cc5
-rw-r--r--googletest/test/gtest-typed-test_test.cc5
-rw-r--r--googletest/test/gtest-typed-test_test.h3
-rw-r--r--googletest/test/gtest-unittest-api_test.cc3
-rw-r--r--googletest/test/gtest_all_test.cc27
-rw-r--r--googletest/test/gtest_assert_by_exception_test.cc5
-rw-r--r--googletest/test/gtest_environment_test.cc3
-rwxr-xr-xgoogletest/test/gtest_help_test.py2
-rw-r--r--googletest/test/gtest_help_test_.cc3
-rw-r--r--googletest/test/gtest_main_unittest.cc3
-rw-r--r--googletest/test/gtest_no_test_unittest.cc2
-rw-r--r--googletest/test/gtest_premature_exit_test.cc3
-rw-r--r--googletest/test/gtest_prod_test.cc5
-rw-r--r--googletest/test/gtest_repeat_test.cc6
-rw-r--r--googletest/test/gtest_sole_header_test.cc3
-rw-r--r--googletest/test/gtest_stress_test.cc3
-rw-r--r--googletest/test/gtest_test_macro_stack_footprint_test.cc89
-rwxr-xr-xgoogletest/test/gtest_test_utils.py12
-rwxr-xr-x[-rw-r--r--]googletest/test/gtest_testbridge_test.py2
-rw-r--r--googletest/test/gtest_testbridge_test_.cc3
-rw-r--r--googletest/test/gtest_throw_on_failure_ex_test.cc3
-rw-r--r--googletest/test/gtest_unittest.cc18
-rw-r--r--googletest/test/gtest_xml_outfile1_test_.cc1
-rw-r--r--googletest/test/gtest_xml_outfile2_test_.cc1
-rwxr-xr-xgoogletest/test/gtest_xml_outfiles_test.py4
-rwxr-xr-xgoogletest/test/gtest_xml_output_unittest.py7
-rw-r--r--googletest/test/production.cc3
-rw-r--r--googletest/test/production.h3
71 files changed, 1118 insertions, 446 deletions
diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel
index 365a855..a930d65 100644
--- a/googletest/test/BUILD.bazel
+++ b/googletest/test/BUILD.bazel
@@ -34,35 +34,65 @@
licenses(["notice"])
-""" gtest own tests """
+config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+)
+
+config_setting(
+ name = "windows_msvc",
+ values = {"cpu": "x64_windows_msvc"},
+)
-#on windows exclude gtest-tuple.h and gtest-tuple_test.cc
+config_setting(
+ name = "has_absl",
+ values = {"define": "absl=1"},
+)
+
+#on windows exclude gtest-tuple.h and googletest-tuple-test.cc
cc_test(
name = "gtest_all_test",
size = "small",
- srcs = glob(
- include = [
- "gtest-*.cc",
- "*.h",
- "googletest/include/gtest/**/*.h",
- ],
- exclude = [
- "gtest-unittest-api_test.cc",
- "gtest-tuple_test.cc",
- "googletest/src/gtest-all.cc",
- "gtest_all_test.cc",
- "gtest-death-test_ex_test.cc",
- "gtest-listener_test.cc",
- "gtest-unittest-api_test.cc",
- "gtest-param-test_test.cc",
- ],
- ) + select({
+ srcs = glob(
+ include = [
+ "gtest-*.cc",
+ "googletest-*.cc",
+ "*.h",
+ "googletest/include/gtest/**/*.h",
+ ],
+ exclude = [
+ "gtest-unittest-api_test.cc",
+ "googletest-tuple-test.cc",
+ "googletest/src/gtest-all.cc",
+ "gtest_all_test.cc",
+ "gtest-death-test_ex_test.cc",
+ "gtest-listener_test.cc",
+ "gtest-unittest-api_test.cc",
+ "googletest-param-test-test.cc",
+ "googletest-catch-exceptions-test_.cc",
+ "googletest-color-test_.cc",
+ "googletest-env-var-test_.cc",
+ "googletest-filter-unittest_.cc",
+ "googletest-break-on-failure-unittest_.cc",
+ "googletest-listener-test.cc",
+ "googletest-output-test_.cc",
+ "googletest-list-tests-unittest_.cc",
+ "googletest-shuffle-test_.cc",
+ "googletest-uninitialized-test_.cc",
+ "googletest-death-test_ex_test.cc",
+ "googletest-param-test-test",
+ "googletest-throw-on-failure-test_.cc",
+ "googletest-param-test-invalid-name1-test_.cc",
+ "googletest-param-test-invalid-name2-test_.cc",
+
+ ],
+ ) + select({
"//:windows": [],
"//:windows_msvc": [],
"//conditions:default": [
- "gtest-tuple_test.cc",
+ "googletest-tuple-test.cc",
],
- }),
+ }),
copts = select({
"//:windows": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
"//:windows_msvc": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
@@ -84,16 +114,28 @@ cc_test(
deps = ["//:gtest_main"],
)
+
+# Tests death tests.
+cc_test(
+ name = "googletest-death-test-test",
+ size = "medium",
+ srcs = ["googletest-death-test-test.cc"],
+ deps = ["//:gtest_main"],
+)
+
+cc_test(
+ name = "gtest_test_macro_stack_footprint_test",
+ size = "small",
+ srcs = ["gtest_test_macro_stack_footprint_test.cc"],
+ deps = ["//:gtest"],
+)
+
#These googletest tests have their own main()
cc_test(
- name = "gtest-listener_test",
+ name = "googletest-listener-test",
size = "small",
- srcs = [
- "gtest-listener_test.cc",
- ],
- deps = [
- "//:gtest",
- ],
+ srcs = ["googletest-listener-test.cc"],
+ deps = ["//:gtest_main"],
)
cc_test(
@@ -108,16 +150,14 @@ cc_test(
)
cc_test(
- name = "gtest-param-test_test",
+ name = "googletest-param-test-test",
size = "small",
srcs = [
- "gtest-param-test2_test.cc",
- "gtest-param-test_test.cc",
- "gtest-param-test_test.h",
- ],
- deps = [
- "//:gtest",
+ "googletest-param-test-test.cc",
+ "googletest-param-test-test.h",
+ "googletest-param-test2-test.cc",
],
+ deps = ["//:gtest"],
)
cc_test(
@@ -135,7 +175,6 @@ py_library(
name = "gtest_test_utils",
testonly = 1,
srcs = ["gtest_test_utils.py"],
-
)
cc_binary(
@@ -144,6 +183,7 @@ cc_binary(
srcs = ["gtest_help_test_.cc"],
deps = ["//:gtest_main"],
)
+
py_test(
name = "gtest_help_test",
size = "small",
@@ -153,82 +193,92 @@ py_test(
)
cc_binary(
- name = "gtest_output_test_",
+ name = "googletest-output-test_",
testonly = 1,
- srcs = ["gtest_output_test_.cc"],
+ srcs = ["googletest-output-test_.cc"],
deps = ["//:gtest"],
)
+
py_test(
- name = "gtest_output_test",
+ name = "googletest-output-test",
size = "small",
- srcs = ["gtest_output_test.py"],
+ srcs = ["googletest-output-test.py"],
+ args = select({
+ ":has_absl": [],
+ "//conditions:default": ["--no_stacktrace_support"],
+ }),
data = [
- "gtest_output_test_golden_lin.txt",
- ":gtest_output_test_",
+ "googletest-output-test-golden-lin.txt",
+ ":googletest-output-test_",
],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_color_test_",
+ name = "googletest-color-test_",
testonly = 1,
- srcs = ["gtest_color_test_.cc"],
+ srcs = ["googletest-color-test_.cc"],
deps = ["//:gtest"],
)
+
py_test(
- name = "gtest_color_test",
+ name = "googletest-color-test",
size = "small",
- srcs = ["gtest_color_test.py"],
- data = [":gtest_color_test_"],
+ srcs = ["googletest-color-test.py"],
+ data = [":googletest-color-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_env_var_test_",
+ name = "googletest-env-var-test_",
testonly = 1,
- srcs = ["gtest_env_var_test_.cc"],
+ srcs = ["googletest-env-var-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_env_var_test",
- size = "small",
- srcs = ["gtest_env_var_test.py"],
- data = [":gtest_env_var_test_"],
+ name = "googletest-env-var-test",
+ size = "medium",
+ srcs = ["googletest-env-var-test.py"],
+ data = [":googletest-env-var-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_filter_unittest_",
+ name = "googletest-filter-unittest_",
testonly = 1,
- srcs = ["gtest_filter_unittest_.cc"],
+ srcs = ["googletest-filter-unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_filter_unittest",
- size = "small",
- srcs = ["gtest_filter_unittest.py"],
- data = [":gtest_filter_unittest_"],
+ name = "googletest-filter-unittest",
+ size = "medium",
+ srcs = ["googletest-filter-unittest.py"],
+ data = [":googletest-filter-unittest_"],
deps = [":gtest_test_utils"],
)
+
cc_binary(
- name = "gtest_break_on_failure_unittest_",
+ name = "googletest-break-on-failure-unittest_",
testonly = 1,
- srcs = ["gtest_break_on_failure_unittest_.cc"],
+ srcs = ["googletest-break-on-failure-unittest_.cc"],
deps = ["//:gtest"],
)
+
+
py_test(
- name = "gtest_break_on_failure_unittest",
+ name = "googletest-break-on-failure-unittest",
size = "small",
- srcs = ["gtest_break_on_failure_unittest.py"],
- data = [":gtest_break_on_failure_unittest_"],
+ srcs = ["googletest-break-on-failure-unittest.py"],
+ data = [":googletest-break-on-failure-unittest_"],
deps = [":gtest_test_utils"],
)
+
cc_test(
name = "gtest_assert_by_exception_test",
size = "small",
@@ -236,72 +286,75 @@ cc_test(
deps = ["//:gtest"],
)
+
+
cc_binary(
- name = "gtest_throw_on_failure_test_",
+ name = "googletest-throw-on-failure-test_",
testonly = 1,
- srcs = ["gtest_throw_on_failure_test_.cc"],
+ srcs = ["googletest-throw-on-failure-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_throw_on_failure_test",
+ name = "googletest-throw-on-failure-test",
size = "small",
- srcs = ["gtest_throw_on_failure_test.py"],
- data = [":gtest_throw_on_failure_test_"],
+ srcs = ["googletest-throw-on-failure-test.py"],
+ data = [":googletest-throw-on-failure-test_"],
deps = [":gtest_test_utils"],
)
+
cc_binary(
- name = "gtest_list_tests_unittest_",
+ name = "googletest-list-tests-unittest_",
testonly = 1,
- srcs = ["gtest_list_tests_unittest_.cc"],
+ srcs = ["googletest-list-tests-unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_list_tests_unittest",
+ name = "googletest-list-tests-unittest",
size = "small",
- srcs = ["gtest_list_tests_unittest.py"],
- data = [":gtest_list_tests_unittest_"],
+ srcs = ["googletest-list-tests-unittest.py"],
+ data = [":googletest-list-tests-unittest_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_shuffle_test_",
- srcs = ["gtest_shuffle_test_.cc"],
+ name = "googletest-shuffle-test_",
+ srcs = ["googletest-shuffle-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_shuffle_test",
+ name = "googletest-shuffle-test",
size = "small",
- srcs = ["gtest_shuffle_test.py"],
- data = [":gtest_shuffle_test_"],
+ srcs = ["googletest-shuffle-test.py"],
+ data = [":googletest-shuffle-test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
- name = "gtest_catch_exceptions_no_ex_test_",
+ name = "googletest-catch-exceptions-no-ex-test_",
testonly = 1,
- srcs = ["gtest_catch_exceptions_test_.cc"],
+ srcs = ["googletest-catch-exceptions-test_.cc"],
deps = ["//:gtest_main"],
)
cc_binary(
- name = "gtest_catch_exceptions_ex_test_",
+ name = "googletest-catch-exceptions-ex-test_",
testonly = 1,
- srcs = ["gtest_catch_exceptions_test_.cc"],
+ srcs = ["googletest-catch-exceptions-test_.cc"],
copts = ["-fexceptions"],
deps = ["//:gtest_main"],
)
py_test(
- name = "gtest_catch_exceptions_test",
+ name = "googletest-catch-exceptions-test",
size = "small",
- srcs = ["gtest_catch_exceptions_test.py"],
+ srcs = ["googletest-catch-exceptions-test.py"],
data = [
- ":gtest_catch_exceptions_ex_test_",
- ":gtest_catch_exceptions_no_ex_test_",
+ ":googletest-catch-exceptions-ex-test_",
+ ":googletest-catch-exceptions-no-ex-test_",
],
deps = [":gtest_test_utils"],
)
@@ -327,6 +380,10 @@ py_test(
"gtest_xml_output_unittest.py",
"gtest_xml_test_utils.py",
],
+ args = select({
+ ":has_absl": [],
+ "//conditions:default": ["--no_stacktrace_support"],
+ }),
data = [
# We invoke gtest_no_test_unittest to verify the XML output
# when the test program contains no test definition.
@@ -365,17 +422,17 @@ py_test(
)
cc_binary(
- name = "gtest_uninitialized_test_",
+ name = "googletest-uninitialized-test_",
testonly = 1,
- srcs = ["gtest_uninitialized_test_.cc"],
+ srcs = ["googletest-uninitialized-test_.cc"],
deps = ["//:gtest"],
)
py_test(
- name = "gtest_uninitialized_test",
+ name = "googletest-uninitialized-test",
size = "medium",
- srcs = ["gtest_uninitialized_test.py"],
- data = [":gtest_uninitialized_test_"],
+ srcs = ["googletest-uninitialized-test.py"],
+ data = ["googletest-uninitialized-test_"],
deps = [":gtest_test_utils"],
)
@@ -394,3 +451,77 @@ py_test(
data = [":gtest_testbridge_test_"],
deps = [":gtest_test_utils"],
)
+
+
+py_test(
+ name = "googletest-json-outfiles-test",
+ size = "small",
+ srcs = [
+ "googletest-json-outfiles-test.py",
+ "gtest_json_test_utils.py",
+ ],
+ data = [
+ ":gtest_xml_outfile1_test_",
+ ":gtest_xml_outfile2_test_",
+ ],
+ deps = [":gtest_test_utils"],
+)
+
+py_test(
+ name = "googletest-json-output-unittest",
+ size = "medium",
+ srcs = [
+ "googletest-json-output-unittest.py",
+ "gtest_json_test_utils.py",
+ ],
+ data = [
+ # We invoke gtest_no_test_unittest to verify the JSON output
+ # when the test program contains no test definition.
+ ":gtest_no_test_unittest",
+ ":gtest_xml_output_unittest_",
+ ],
+ args = select({
+ ":has_absl": [],
+ "//conditions:default": ["--no_stacktrace_support"],
+ }),
+ deps = [":gtest_test_utils"],
+)
+# Verifies interaction of death tests and exceptions.
+cc_test(
+ name = "googletest-death-test_ex_catch_test",
+ size = "medium",
+ srcs = ["googletest-death-test_ex_test.cc"],
+ copts = ["-fexceptions"],
+ defines = ["GTEST_ENABLE_CATCH_EXCEPTIONS_=1"],
+ deps = ["//:gtest"],
+)
+
+cc_binary(
+ name = "googletest-param-test-invalid-name1-test_",
+ testonly = 1,
+ srcs = ["googletest-param-test-invalid-name1-test_.cc"],
+ deps = ["//:gtest"],
+)
+
+cc_binary(
+ name = "googletest-param-test-invalid-name2-test_",
+ testonly = 1,
+ srcs = ["googletest-param-test-invalid-name2-test_.cc"],
+ deps = ["//:gtest"],
+)
+
+py_test(
+ name = "googletest-param-test-invalid-name1-test",
+ size = "small",
+ srcs = ["googletest-param-test-invalid-name1-test.py"],
+ data = [":googletest-param-test-invalid-name1-test_"],
+ deps = [":gtest_test_utils"],
+)
+
+py_test(
+ name = "googletest-param-test-invalid-name2-test",
+ size = "small",
+ srcs = ["googletest-param-test-invalid-name2-test.py"],
+ data = [":googletest-param-test-invalid-name2-test_"],
+ deps = [":gtest_test_utils"],
+)
diff --git a/googletest/test/gtest_break_on_failure_unittest.py b/googletest/test/googletest-break-on-failure-unittest.py
index 16e19db..a5dfbc6 100755
--- a/googletest/test/gtest_break_on_failure_unittest.py
+++ b/googletest/test/googletest-break-on-failure-unittest.py
@@ -34,12 +34,10 @@
A user can ask Google Test to seg-fault when an assertion fails, using
either the GTEST_BREAK_ON_FAILURE environment variable or the
--gtest_break_on_failure flag. This script tests such functionality
-by invoking gtest_break_on_failure_unittest_ (a program written with
+by invoking googletest-break-on-failure-unittest_ (a program written with
Google Test) with different environments and command line flags.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -59,9 +57,9 @@ THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
# The environment variable for enabling/disabling the catch-exceptions mode.
CATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS'
-# Path to the gtest_break_on_failure_unittest_ program.
+# Path to the googletest-break-on-failure-unittest_ program.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_break_on_failure_unittest_')
+ 'googletest-break-on-failure-unittest_')
environ = gtest_test_utils.environ
@@ -95,7 +93,7 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
"""
def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault):
- """Runs gtest_break_on_failure_unittest_ and verifies that it does
+ """Runs googletest-break-on-failure-unittest_ and verifies that it does
(or does not) have a seg-fault.
Args:
diff --git a/googletest/test/gtest_break_on_failure_unittest_.cc b/googletest/test/googletest-break-on-failure-unittest_.cc
index 1231ec2..f84957a 100644
--- a/googletest/test/gtest_break_on_failure_unittest_.cc
+++ b/googletest/test/googletest-break-on-failure-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Unit test for Google Test's break-on-failure mode.
//
diff --git a/googletest/test/gtest_catch_exceptions_test.py b/googletest/test/googletest-catch-exceptions-test.py
index 760f914..5d49c10 100755
--- a/googletest/test/gtest_catch_exceptions_test.py
+++ b/googletest/test/googletest-catch-exceptions-test.py
@@ -30,13 +30,11 @@
"""Tests Google Test's exception catching behavior.
-This script invokes gtest_catch_exceptions_test_ and
-gtest_catch_exceptions_ex_test_ (programs written with
+This script invokes googletest-catch-exceptions-test_ and
+googletest-catch-exceptions-ex-test_ (programs written with
Google Test) and verifies their output.
"""
-__author__ = 'vladl@google.com (Vlad Losev)'
-
import gtest_test_utils
# Constants.
@@ -45,15 +43,15 @@ LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
FILTER_FLAG = FLAG_PREFIX + 'filter'
-# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
+# Path to the googletest-catch-exceptions-ex-test_ binary, compiled with
# exceptions enabled.
EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_ex_test_')
+ 'googletest-catch-exceptions-ex-test_')
-# Path to the gtest_catch_exceptions_test_ binary, compiled with
+# Path to the googletest-catch-exceptions-test_ binary, compiled with
# exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_catch_exceptions_no_ex_test_')
+ 'googletest-catch-exceptions-no-ex-test_')
environ = gtest_test_utils.environ
SetEnvVar = gtest_test_utils.SetEnvVar
diff --git a/googletest/test/gtest_catch_exceptions_test_.cc b/googletest/test/googletest-catch-exceptions-test_.cc
index c6d953c..09dae70 100644
--- a/googletest/test/gtest_catch_exceptions_test_.cc
+++ b/googletest/test/googletest-catch-exceptions-test_.cc
@@ -26,17 +26,17 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. Tests in this file throw C++ or SEH
-// exceptions, and the output is verified by gtest_catch_exceptions_test.py.
-
-#include "gtest/gtest.h"
+// exceptions, and the output is verified by
+// googletest-catch-exceptions-test.py.
#include <stdio.h> // NOLINT
#include <stdlib.h> // For exit().
+#include "gtest/gtest.h"
+
#if GTEST_HAS_SEH
# include <windows.h>
#endif
diff --git a/googletest/test/gtest_color_test.py b/googletest/test/googletest-color-test.py
index 49b8ed2..f3b7c99 100755
--- a/googletest/test/gtest_color_test.py
+++ b/googletest/test/googletest-color-test.py
@@ -31,8 +31,6 @@
"""Verifies that Google Test correctly determines whether to use colors."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -40,7 +38,7 @@ IS_WINDOWS = os.name == 'nt'
COLOR_ENV_VAR = 'GTEST_COLOR'
COLOR_FLAG = 'gtest_color'
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-color-test_')
def SetEnvVar(env_var, value):
@@ -53,7 +51,7 @@ def SetEnvVar(env_var, value):
def UsesColor(term, color_env_var, color_flag):
- """Runs gtest_color_test_ and returns its exit code."""
+ """Runs googletest-color-test_ and returns its exit code."""
SetEnvVar('TERM', term)
SetEnvVar(COLOR_ENV_VAR, color_env_var)
diff --git a/googletest/test/gtest_color_test_.cc b/googletest/test/googletest-color-test_.cc
index f9a21e2..220a3a0 100644
--- a/googletest/test/gtest_color_test_.cc
+++ b/googletest/test/googletest-color-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// A helper program for testing how Google Test determines whether to use
// colors in the output. It prints "YES" and returns 1 if Google Test
diff --git a/googletest/test/gtest-death-test_test.cc b/googletest/test/googletest-death-test-test.cc
index 37261cb..c0c3026 100644
--- a/googletest/test/gtest-death-test_test.cc
+++ b/googletest/test/googletest-death-test-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for death tests.
@@ -784,7 +783,7 @@ static void TestExitMacros() {
// Of all signals effects on the process exit code, only those of SIGABRT
// are documented on Windows.
- // See http://msdn.microsoft.com/en-us/library/dwwzkt4c(VS.71).aspx.
+ // See https://msdn.microsoft.com/en-us/query-bi/m/dwwzkt4c.
EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
# elif !GTEST_OS_FUCHSIA
@@ -1280,7 +1279,7 @@ TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
# if GTEST_OS_WINDOWS
TEST(EnvironmentTest, HandleFitsIntoSizeT) {
- // TODO(vladl@google.com): Remove this test after this condition is verified
+ // FIXME: Remove this test after this condition is verified
// in a static assertion in gtest-death-test.cc in the function
// GetStatusFileDescriptor.
ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
diff --git a/googletest/test/gtest-death-test_ex_test.cc b/googletest/test/googletest-death-test_ex_test.cc
index b50a13d..b8b9470 100644
--- a/googletest/test/gtest-death-test_ex_test.cc
+++ b/googletest/test/googletest-death-test_ex_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests that verify interaction of exceptions and death tests.
@@ -69,7 +68,7 @@ TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
"exceptional message");
// Verifies that the location is mentioned in the failure text.
EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "gtest-death-test_ex_test.cc");
+ "googletest-death-test_ex_test.cc");
}
# endif // GTEST_HAS_EXCEPTIONS
diff --git a/googletest/test/gtest_env_var_test.py b/googletest/test/googletest-env-var-test.py
index beb2a8b..e1efeee 100755
--- a/googletest/test/gtest_env_var_test.py
+++ b/googletest/test/googletest-env-var-test.py
@@ -31,8 +31,6 @@
"""Verifies that Google Test correctly parses environment variables."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -40,7 +38,7 @@ import gtest_test_utils
IS_WINDOWS = os.name == 'nt'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_env_var_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-env-var-test_')
environ = os.environ.copy()
@@ -62,7 +60,7 @@ def SetEnvVar(env_var, value):
def GetFlag(flag):
- """Runs gtest_env_var_test_ and returns its output."""
+ """Runs googletest-env-var-test_ and returns its output."""
args = [COMMAND]
if flag is not None:
diff --git a/googletest/test/gtest_env_var_test_.cc b/googletest/test/googletest-env-var-test_.cc
index 9b668dc..fd2aa82 100644
--- a/googletest/test/gtest_env_var_test_.cc
+++ b/googletest/test/googletest-env-var-test_.cc
@@ -26,16 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// A helper program for testing that Google Test parses the environment
// variables correctly.
-#include "gtest/gtest.h"
-
#include <iostream>
+#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h"
using ::std::cout;
@@ -115,7 +113,7 @@ int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
if (argc != 2) {
- cout << "Usage: gtest_env_var_test_ NAME_OF_FLAG\n";
+ cout << "Usage: googletest-env-var-test_ NAME_OF_FLAG\n";
return 1;
}
diff --git a/googletest/test/gtest-filepath_test.cc b/googletest/test/googletest-filepath-test.cc
index 29cea3d..37f02fb 100644
--- a/googletest/test/gtest-filepath_test.cc
+++ b/googletest/test/googletest-filepath-test.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// Google Test filepath utilities
//
// This file tests classes and functions used internally by
@@ -51,7 +50,7 @@ namespace internal {
namespace {
#if GTEST_OS_WINDOWS_MOBILE
-// TODO(wan@google.com): Move these to the POSIX adapter section in
+// FIXME: Move these to the POSIX adapter section in
// gtest-port.h.
// Windows CE doesn't have the remove C function.
diff --git a/googletest/test/gtest_filter_unittest.py b/googletest/test/googletest-filter-unittest.py
index 92cc77c..dc0b5bd 100755
--- a/googletest/test/gtest_filter_unittest.py
+++ b/googletest/test/googletest-filter-unittest.py
@@ -33,15 +33,13 @@
A user can specify which test(s) in a Google Test program to run via either
the GTEST_FILTER environment variable or the --gtest_filter flag.
This script tests such functionality by invoking
-gtest_filter_unittest_ (a program written with Google Test) with different
+googletest-filter-unittest_ (a program written with Google Test) with different
environments and command line flags.
Note that test sharding may also influence which tests are filtered. Therefore,
we test that here also.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import re
import sets
@@ -100,8 +98,8 @@ FILTER_FLAG = 'gtest_filter'
# The command line flag for including disabled tests.
ALSO_RUN_DISABLED_TESTS_FLAG = 'gtest_also_run_disabled_tests'
-# Command to run the gtest_filter_unittest_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_filter_unittest_')
+# Command to run the googletest-filter-unittest_ program.
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-filter-unittest_')
# Regex for determining whether parameterized tests are enabled in the binary.
PARAM_TEST_REGEX = re.compile(r'/ParamTest')
@@ -120,7 +118,7 @@ LIST_TESTS_FLAG = '--gtest_list_tests'
SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
[COMMAND, LIST_TESTS_FLAG]).output
-# Full names of all tests in gtest_filter_unittests_.
+# Full names of all tests in googletest-filter-unittests_.
PARAM_TESTS = [
'SeqP/ParamTest.TestX/0',
'SeqP/ParamTest.TestX/1',
@@ -292,7 +290,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
args=None, check_exit_0=False):
"""Checks that binary runs correct tests for the given filter and shard.
- Runs all shards of gtest_filter_unittest_ with the given filter, and
+ Runs all shards of googletest-filter-unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.
If check_exit_0, .
@@ -330,7 +328,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
"""Checks that the binary runs correct set of tests for the given filter.
- Runs gtest_filter_unittest_ with the given filter, and enables
+ Runs googletest-filter-unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.
Args:
diff --git a/googletest/test/gtest_filter_unittest_.cc b/googletest/test/googletest-filter-unittest_.cc
index e74a7a3..d335b60 100644
--- a/googletest/test/gtest_filter_unittest_.cc
+++ b/googletest/test/googletest-filter-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Unit test for Google Test test filters.
//
diff --git a/googletest/test/gtest_json_outfiles_test.py b/googletest/test/googletest-json-outfiles-test.py
index 46010d8..c99be48 100644
--- a/googletest/test/gtest_json_outfiles_test.py
+++ b/googletest/test/googletest-json-outfiles-test.py
@@ -136,11 +136,11 @@ class GTestJsonOutFilesTest(gtest_test_utils.TestCase):
self.assert_(p.exited)
self.assertEquals(0, p.exit_code)
- # TODO(wan@google.com): libtool causes the built test binary to be
+ # FIXME: libtool causes the built test binary to be
# named lt-gtest_xml_outfiles_test_ instead of
# gtest_xml_outfiles_test_. To account for this possibility, we
# allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
+ # when libtool replacement tool is ready.
output_file_name1 = test_name + '.json'
output_file1 = os.path.join(self.output_dir_, output_file_name1)
output_file_name2 = 'lt-' + output_file_name1
diff --git a/googletest/test/gtest_json_output_unittest.py b/googletest/test/googletest-json-output-unittest.py
index 12047c4..57dcd5f 100644
--- a/googletest/test/gtest_json_output_unittest.py
+++ b/googletest/test/googletest-json-output-unittest.py
@@ -46,7 +46,10 @@ GTEST_OUTPUT_FLAG = '--gtest_output'
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.json'
GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_'
-SUPPORTS_STACK_TRACES = False
+# The flag indicating stacktraces are not supported
+NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
+
+SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
@@ -607,5 +610,9 @@ class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
if __name__ == '__main__':
+ if NO_STACKTRACE_SUPPORT_FLAG in sys.argv:
+ # unittest.main() can't handle unknown flags
+ sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
+
os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
gtest_test_utils.Main()
diff --git a/googletest/test/gtest-linked_ptr_test.cc b/googletest/test/googletest-linked-ptr-test.cc
index 6fcf512..fa00f34 100644
--- a/googletest/test/gtest-linked_ptr_test.cc
+++ b/googletest/test/googletest-linked-ptr-test.cc
@@ -26,13 +26,10 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: Dan Egnor (egnor@google.com)
-// Ported to Windows: Vadim Berman (vadimb@google.com)
-
-#include "gtest/internal/gtest-linked_ptr.h"
#include <stdlib.h>
+
+#include "gtest/internal/gtest-linked_ptr.h"
#include "gtest/gtest.h"
namespace {
diff --git a/googletest/test/gtest_list_tests_unittest.py b/googletest/test/googletest-list-tests-unittest.py
index ebf1a3c..81423a3 100755
--- a/googletest/test/gtest_list_tests_unittest.py
+++ b/googletest/test/googletest-list-tests-unittest.py
@@ -33,12 +33,10 @@
A user can ask Google Test to list all tests by specifying the
--gtest_list_tests flag. This script tests such functionality
-by invoking gtest_list_tests_unittest_ (a program written with
+by invoking googletest-list-tests-unittest_ (a program written with
Google Test) the command line flags.
"""
-__author__ = 'phanna@google.com (Patrick Hanna)'
-
import re
import gtest_test_utils
@@ -47,10 +45,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling listing all tests.
LIST_TESTS_FLAG = 'gtest_list_tests'
-# Path to the gtest_list_tests_unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_list_tests_unittest_')
+# Path to the googletest-list-tests-unittest_ program.
+EXE_PATH = gtest_test_utils.GetTestExecutablePath('googletest-list-tests-unittest_')
-# The expected output when running gtest_list_tests_unittest_ with
+# The expected output when running googletest-list-tests-unittest_ with
# --gtest_list_tests
EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\.
Test1
@@ -94,7 +92,7 @@ MyInstantiation/ValueParamTest\.
TestB/2 # GetParam\(\) = a very\\nlo{241}\.\.\.
""")
-# The expected output when running gtest_list_tests_unittest_ with
+# The expected output when running googletest-list-tests-unittest_ with
# --gtest_list_tests and --gtest_filter=Foo*.
EXPECTED_OUTPUT_FILTER_FOO_RE = re.compile(r"""FooDeathTest\.
Test1
@@ -114,7 +112,7 @@ FooTest\.
def Run(args):
- """Runs gtest_list_tests_unittest_ and returns the list of tests printed."""
+ """Runs googletest-list-tests-unittest_ and returns the list of tests printed."""
return gtest_test_utils.Subprocess([EXE_PATH] + args,
capture_stderr=False).output
@@ -127,7 +125,7 @@ class GTestListTestsUnitTest(gtest_test_utils.TestCase):
"""Tests using the --gtest_list_tests flag to list all tests."""
def RunAndVerify(self, flag_value, expected_output_re, other_flag):
- """Runs gtest_list_tests_unittest_ and verifies that it prints
+ """Runs googletest-list-tests-unittest_ and verifies that it prints
the correct tests.
Args:
diff --git a/googletest/test/gtest_list_tests_unittest_.cc b/googletest/test/googletest-list-tests-unittest_.cc
index 907c176..f473c7d 100644
--- a/googletest/test/gtest_list_tests_unittest_.cc
+++ b/googletest/test/googletest-list-tests-unittest_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: phanna@google.com (Patrick Hanna)
+
// Unit test for Google Test's --gtest_list_tests flag.
//
diff --git a/googletest/test/gtest-listener_test.cc b/googletest/test/googletest-listener-test.cc
index 639529c..8355597 100644
--- a/googletest/test/gtest-listener_test.cc
+++ b/googletest/test/googletest-listener-test.cc
@@ -25,17 +25,17 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This file verifies Google Test event listeners receive events at the
// right times.
-#include "gtest/gtest.h"
#include <vector>
+#include "gtest/gtest.h"
+
using ::testing::AddGlobalTestEnvironment;
using ::testing::Environment;
using ::testing::InitGoogleTest;
diff --git a/googletest/test/gtest-message_test.cc b/googletest/test/googletest-message-test.cc
index 175238e..c644585 100644
--- a/googletest/test/gtest-message_test.cc
+++ b/googletest/test/googletest-message-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for the Message class.
diff --git a/googletest/test/gtest-options_test.cc b/googletest/test/googletest-options-test.cc
index 10cb1df..edd4eba 100644
--- a/googletest/test/gtest-options_test.cc
+++ b/googletest/test/googletest-options-test.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// Google Test UnitTestOptions tests
//
// This file tests classes and functions used internally by
@@ -99,17 +98,16 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
const std::string exe_str = GetCurrentExecutableName().string();
#if GTEST_OS_WINDOWS
const bool success =
- _strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
+ _strcmpi("googletest-options-test", exe_str.c_str()) == 0 ||
_strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
_strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
#elif GTEST_OS_FUCHSIA
const bool success = exe_str == "app";
#else
- // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
- // Chandler Carruth's libtool replacement is ready.
+ // FIXME: remove the hard-coded "lt-" prefix when libtool replacement is ready
const bool success =
- exe_str == "gtest-options_test" ||
+ exe_str == "googletest-options-test" ||
exe_str == "gtest_all_test" ||
exe_str == "lt-gtest_all_test" ||
exe_str == "gtest_dll_test";
diff --git a/googletest/test/gtest_output_test_golden_lin.txt b/googletest/test/googletest-output-test-golden-lin.txt
index cbcb720..b0c5189 100644
--- a/googletest/test/gtest_output_test_golden_lin.txt
+++ b/googletest/test/googletest-output-test-golden-lin.txt
@@ -1,13 +1,17 @@
The non-test part of the code is expected to have 2 failures.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
3
+Stack trace: (omitted)
+
[==========] Running 68 tests from 30 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
@@ -34,21 +38,25 @@ BarEnvironment::SetUp() called.
[ OK ] PassingTest.PassingTest2
[----------] 2 tests from NonfatalFailureTest
[ RUN ] NonfatalFailureTest.EscapesStringOperands
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
kGoldenString
Which is: "\"Line"
actual
Which is: "actual \"string\""
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
golden
Which is: "\"Line"
actual
Which is: "actual \"string\""
+Stack trace: (omitted)
+
[ FAILED ] NonfatalFailureTest.EscapesStringOperands
[ RUN ] NonfatalFailureTest.DiffForLongStrings
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
golden_str
Which is: "\"Line\0 1\"\nLine 2"
@@ -58,241 +66,323 @@ With diff:
-\"Line\0 1\"
Line 2
+Stack trace: (omitted)
+
[ FAILED ] NonfatalFailureTest.DiffForLongStrings
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
[----------] 1 test from LoggingTest
[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
+Stack trace: (omitted)
+
i == 2
i == 3
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
+Stack trace: (omitted)
+
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
[----------] 7 tests from SCOPED_TRACETest
[ RUN ] SCOPED_TRACETest.AcceptedValues
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Just checking that all these values work fine.
Google Test trace:
-gtest_output_test_.cc:#: (null)
-gtest_output_test_.cc:#: 1337
-gtest_output_test_.cc:#: std::string
-gtest_output_test_.cc:#: literal string
+googletest-output-test_.cc:#: (null)
+googletest-output-test_.cc:#: 1337
+googletest-output-test_.cc:#: std::string
+googletest-output-test_.cc:#: literal string
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.AcceptedValues
[ RUN ] SCOPED_TRACETest.ObeysScopes
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and shouldn't have a trace.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should have a trace.
Google Test trace:
-gtest_output_test_.cc:#: Expected trace
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Expected trace
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and shouldn't have a trace.
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.ObeysScopes
[ RUN ] SCOPED_TRACETest.WorksInLoop
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
n
Which is: 1
Google Test trace:
-gtest_output_test_.cc:#: i = 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: i = 1
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: i = 2
+googletest-output-test_.cc:#: i = 2
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
2
n
Which is: 1
Google Test trace:
-gtest_output_test_.cc:#: n = 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: n = 1
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: n = 2
+googletest-output-test_.cc:#: n = 2
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
n
Which is: 2
Google Test trace:
-gtest_output_test_.cc:#: n = 2
-gtest_output_test_.cc:#:
+googletest-output-test_.cc:#: n = 2
+googletest-output-test_.cc:#:
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.CanBeNested
[ RUN ] SCOPED_TRACETest.CanBeRepeated
(expected to fail)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A.
Google Test trace:
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: A
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A and B.
Google Test trace:
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and C.
Google Test trace:
-gtest_output_test_.cc:#: C
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: C
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and D.
Google Test trace:
-gtest_output_test_.cc:#: D
-gtest_output_test_.cc:#: B
-gtest_output_test_.cc:#: A
+googletest-output-test_.cc:#: D
+googletest-output-test_.cc:#: B
+googletest-output-test_.cc:#: A
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.CanBeRepeated
[ RUN ] SCOPED_TRACETest.WorksConcurrently
(expecting 6 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1 (in thread B, only trace B alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace B
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Trace B
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2 (in thread A, trace A & B both alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace A
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Trace A
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3 (in thread B, trace A & B both alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace B
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Trace B
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4 (in thread B, only trace A alive).
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #5 (in thread A, only trace A alive).
Google Test trace:
-gtest_output_test_.cc:#: Trace A
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Trace A
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #6 (in thread A, no trace alive).
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.WorksConcurrently
[----------] 1 test from ScopedTraceTest
[ RUN ] ScopedTraceTest.WithExplicitFileAndLine
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Check that the trace is attached to a particular location.
Google Test trace:
explicit_file.cc:123: expected trace message
+Stack trace: (omitted)
+
[ FAILED ] ScopedTraceTest.WithExplicitFileAndLine
[----------] 1 test from NonFatalFailureInFixtureConstructorTest
[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 5 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in SetUp().
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in the test body.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4, in TearDown.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #5, in the test fixture d'tor.
+Stack trace: (omitted)
+
[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
[----------] 1 test from FatalFailureInFixtureConstructorTest
[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in the test fixture d'tor.
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
[----------] 1 test from NonFatalFailureInSetUpTest
[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
(expecting 4 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in the test function.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in TearDown().
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #4, in the test fixture d'tor.
+Stack trace: (omitted)
+
[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
[----------] 1 test from FatalFailureInSetUpTest
[ RUN ] FatalFailureInSetUpTest.FailureInSetUp
(expecting 3 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #2, in TearDown().
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected failure #3, in the test fixture d'tor.
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
[----------] 1 test from AddFailureAtTest
[ RUN ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
foo.cc:42: Failure
Failed
Expected failure in foo.cc
+Stack trace: (omitted)
+
[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
[----------] 4 tests from MixedUpTestCaseTest
[ RUN ] MixedUpTestCaseTest.FirstTestFromNamespaceFoo
@@ -309,6 +399,8 @@ using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation
units and have the same name. You should probably rename one
of the classes to put the tests into different test cases.
+Stack trace: (omitted)
+
[ FAILED ] MixedUpTestCaseTest.ThisShouldFail
[ RUN ] MixedUpTestCaseTest.ThisShouldFailToo
gtest.cc:#: Failure
@@ -320,6 +412,8 @@ using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation
units and have the same name. You should probably rename one
of the classes to put the tests into different test cases.
+Stack trace: (omitted)
+
[ FAILED ] MixedUpTestCaseTest.ThisShouldFailToo
[----------] 2 tests from MixedUpTestCaseWithSameTestNameTest
[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
@@ -334,6 +428,8 @@ using two different test fixture classes. This can happen if
the two classes are from different namespaces or translation
units and have the same name. You should probably rename one
of the classes to put the tests into different test cases.
+Stack trace: (omitted)
+
[ FAILED ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[----------] 2 tests from TEST_F_before_TEST_in_same_test_case
[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
@@ -348,6 +444,8 @@ test DefinedUsingTEST_F is defined using TEST_F but
test DefinedUsingTESTAndShouldFail is defined using TEST. You probably
want to change the TEST to TEST_F or move it to another test
case.
+Stack trace: (omitted)
+
[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
[----------] 2 tests from TEST_before_TEST_F_in_same_test_case
[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
@@ -362,6 +460,8 @@ test DefinedUsingTEST_FAndShouldFail is defined using TEST_F but
test DefinedUsingTEST is defined using TEST. You probably
want to change the TEST to TEST_F or move it to another test
case.
+Stack trace: (omitted)
+
[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
[----------] 8 tests from ExpectNonfatalFailureTest
[ RUN ] ExpectNonfatalFailureTest.CanReferenceGlobalVariables
@@ -375,19 +475,27 @@ case.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 2 failures
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 1.
+Stack trace: (omitted)
-gtest_output_test_.cc:#: Non-fatal failure:
+
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 2.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
@@ -395,9 +503,13 @@ Expected non-fatal failure 2.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
@@ -405,12 +517,16 @@ Expected fatal failure.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
[----------] 8 tests from ExpectFatalFailureTest
[ RUN ] ExpectFatalFailureTest.CanReferenceGlobalVariables
@@ -424,19 +540,27 @@ Expected: 1 non-fatal failure
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 2 failures
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
@@ -444,9 +568,13 @@ Expected fatal failure.
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenStatementReturns
@@ -454,72 +582,94 @@ Expected non-fatal failure.
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[ RUN ] ExpectFatalFailureTest.FailsWhenStatementThrows
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
[----------] 2 tests from TypedTest/0, where TypeParam = int
[ RUN ] TypedTest/0.Success
[ OK ] TypedTest/0.Success
[ RUN ] TypedTest/0.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
TypeParam()
Which is: 0
Expected failure
+Stack trace: (omitted)
+
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1U
Which is: 1
TypeParam()
Which is: '\0'
Expected failure
+Stack trace: (omitted)
+
[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned
+[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Failure
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1U
Which is: 1
TypeParam()
Which is: 0
Expected failure
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned
+Stack trace: (omitted)
+
+[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[----------] 4 tests from ExpectFailureTest
[ RUN ] ExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectFatalFailure
[ RUN ] ExpectFailureTest.ExpectNonFatalFailure
@@ -527,24 +677,36 @@ Expected fatal failure.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ RUN ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
@@ -552,24 +714,36 @@ Expected non-fatal failure.
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 fatal failure containing "Some other fatal failure expected."
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
[ RUN ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
@@ -577,83 +751,115 @@ Expected fatal failure.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Success:
+googletest-output-test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual:
-gtest_output_test_.cc:#: Fatal failure:
+googletest-output-test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure containing "Some other non-fatal failure."
Actual:
-gtest_output_test_.cc:#: Non-fatal failure:
+googletest-output-test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[----------] 2 tests from ExpectFailureWithThreadsTest
[ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
[ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
[----------] 1 test from ScopedFakeTestPartResultReporterTest
[ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
(expecting 2 failures)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
-gtest_output_test_.cc:#: Failure
+Stack trace: (omitted)
+
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
[----------] 1 test from PrintingFailingParams/FailingParamTest
[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
GetParam()
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[----------] 2 tests from PrintingStrings/ParamTest
[ RUN ] PrintingStrings/ParamTest.Success/a
[ OK ] PrintingStrings/ParamTest.Success/a
[ RUN ] PrintingStrings/ParamTest.Failure/a
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
"b"
GetParam()
Which is: "a"
Expected failure
+Stack trace: (omitted)
+
[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
FooEnvironment::TearDown() called.
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
[==========] 68 tests from 30 test cases ran.
[ PASSED ] 22 tests.
[ FAILED ] 46 tests, listed below:
@@ -693,7 +899,7 @@ Expected fatal failure.
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned
+[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[ FAILED ] ExpectFailureTest.ExpectFatalFailure
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
@@ -713,26 +919,32 @@ Expected fatal failure.
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected equality of these values:
1
x
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
[----------] 3 tests from FatalFailureTest (? ms total)
@@ -741,12 +953,16 @@ Expected: true
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
+Stack trace: (omitted)
+
i == 2
i == 3
-gtest_output_test_.cc:#: Failure
+googletest-output-test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
+Stack trace: (omitted)
+
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions (? ms)
[----------] 1 test from LoggingTest (? ms total)
diff --git a/googletest/test/gtest_output_test.py b/googletest/test/googletest-output-test.py
index f83d3be..2d69e35 100755
--- a/googletest/test/gtest_output_test.py
+++ b/googletest/test/googletest-output-test.py
@@ -31,16 +31,13 @@
"""Tests the text output of Google C++ Testing and Mocking Framework.
-
-SYNOPSIS
- gtest_output_test.py --build_dir=BUILD/DIR --gengolden
- # where BUILD/DIR contains the built gtest_output_test_ file.
- gtest_output_test.py --gengolden
- gtest_output_test.py
+To update the golden file:
+googletest_output_test.py --build_dir=BUILD/DIR --gengolden
+where BUILD/DIR contains the built googletest-output-test_ file.
+googletest_output_test.py --gengolden
+googletest_output_test.py
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import difflib
import os
import re
@@ -52,13 +49,16 @@ import gtest_test_utils
GENGOLDEN_FLAG = '--gengolden'
CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
+# The flag indicating stacktraces are not supported
+NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
+
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
-# TODO(vladl@google.com): remove the _lin suffix.
-GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
+# FIXME: remove the _lin suffix.
+GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_')
+PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
# At least one command we exercise must not have the
# 'internal_skip_environment_and_ad_hoc_tests' argument.
@@ -101,7 +101,7 @@ def RemoveLocations(test_output):
'FILE_NAME:#: '.
"""
- return re.sub(r'.*[/\\]((gtest_output_test_|gtest).cc)(\:\d+|\(\d+\))\: ',
+ return re.sub(r'.*[/\\]((googletest-output-test_|gtest).cc)(\:\d+|\(\d+\))\: ',
r'\1:#: ', test_output)
@@ -192,7 +192,7 @@ def RemoveMatchingTests(test_output, pattern):
def NormalizeOutput(output):
- """Normalizes output (the output of gtest_output_test_.exe)."""
+ """Normalizes output (the output of googletest-output-test_.exe)."""
output = ToUnixLineEnding(output)
output = RemoveLocations(output)
@@ -252,13 +252,12 @@ test_list = GetShellCommandOutput(COMMAND_LIST_TESTS)
SUPPORTS_DEATH_TESTS = 'DeathTest' in test_list
SUPPORTS_TYPED_TESTS = 'TypedTest' in test_list
SUPPORTS_THREADS = 'ExpectFailureWithThreadsTest' in test_list
-SUPPORTS_STACK_TRACES = IS_LINUX
+SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
CAN_GENERATE_GOLDEN_FILE = (SUPPORTS_DEATH_TESTS and
SUPPORTS_TYPED_TESTS and
SUPPORTS_THREADS and
- SUPPORTS_STACK_TRACES and
- not IS_WINDOWS)
+ SUPPORTS_STACK_TRACES)
class GTestOutputTest(gtest_test_utils.TestCase):
def RemoveUnsupportedTests(self, test_output):
@@ -314,18 +313,22 @@ class GTestOutputTest(gtest_test_utils.TestCase):
if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
open(os.path.join(
gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_actual.txt'), 'wb').write(
+ '_googletest-output-test_normalized_actual.txt'), 'wb').write(
normalized_actual)
open(os.path.join(
gtest_test_utils.GetSourceDir(),
- '_gtest_output_test_normalized_golden.txt'), 'wb').write(
+ '_googletest-output-test_normalized_golden.txt'), 'wb').write(
normalized_golden)
self.assertEqual(normalized_golden, normalized_actual)
if __name__ == '__main__':
- if sys.argv[1:] == [GENGOLDEN_FLAG]:
+ if NO_STACKTRACE_SUPPORT_FLAG in sys.argv:
+ # unittest.main() can't handle unknown flags
+ sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
+
+ if GENGOLDEN_FLAG in sys.argv:
if CAN_GENERATE_GOLDEN_FILE:
output = GetOutputOfAllCommands()
golden_file = open(GOLDEN_PATH, 'wb')
diff --git a/googletest/test/gtest_output_test_.cc b/googletest/test/googletest-output-test_.cc
index 9ae9dc6..3860cf4 100644
--- a/googletest/test/gtest_output_test_.cc
+++ b/googletest/test/googletest-output-test_.cc
@@ -29,11 +29,9 @@
//
// The purpose of this file is to generate Google Test output under
// various conditions. The output will then be verified by
-// gtest_output_test.py to ensure that Google Test generates the
+// googletest-output-test.py to ensure that Google Test generates the
// desired messages. Therefore, most tests in this file are MEANT TO
// FAIL.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
diff --git a/googletest/test/googletest-param-test-invalid-name1-test.py b/googletest/test/googletest-param-test-invalid-name1-test.py
new file mode 100644
index 0000000..2a08477
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name1-test.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Verifies that Google Test warns the user when not initialized properly."""
+
+import gtest_test_utils
+
+binary_name = 'googletest-param-test-invalid-name1-test_'
+COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
+
+
+def Assert(condition):
+ if not condition:
+ raise AssertionError
+
+
+def TestExitCodeAndOutput(command):
+ """Runs the given command and verifies its exit code and output."""
+
+ err = ('Parameterized test name \'"InvalidWithQuotes"\' is invalid')
+
+ p = gtest_test_utils.Subprocess(command)
+ Assert(p.terminated_by_signal)
+
+ # Verify the output message contains appropriate output
+ Assert(err in p.output)
+
+
+class GTestParamTestInvalidName1Test(gtest_test_utils.TestCase):
+
+ def testExitCodeAndOutput(self):
+ TestExitCodeAndOutput(COMMAND)
+
+
+if __name__ == '__main__':
+ gtest_test_utils.Main()
diff --git a/googletest/test/googletest-param-test-invalid-name1-test_.cc b/googletest/test/googletest-param-test-invalid-name1-test_.cc
new file mode 100644
index 0000000..5a95155
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name1-test_.cc
@@ -0,0 +1,50 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#include "gtest/gtest.h"
+
+namespace {
+class DummyTest : public ::testing::TestWithParam<const char *> {};
+
+TEST_P(DummyTest, Dummy) {
+}
+
+INSTANTIATE_TEST_CASE_P(InvalidTestName,
+ DummyTest,
+ ::testing::Values("InvalidWithQuotes"),
+ ::testing::PrintToStringParamName());
+
+} // namespace
+
+int main(int argc, char *argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
diff --git a/googletest/test/googletest-param-test-invalid-name2-test.py b/googletest/test/googletest-param-test-invalid-name2-test.py
new file mode 100644
index 0000000..ab838f4
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name2-test.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Verifies that Google Test warns the user when not initialized properly."""
+
+import gtest_test_utils
+
+binary_name = 'googletest-param-test-invalid-name2-test_'
+COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
+
+
+def Assert(condition):
+ if not condition:
+ raise AssertionError
+
+
+def TestExitCodeAndOutput(command):
+ """Runs the given command and verifies its exit code and output."""
+
+ err = ('Duplicate parameterized test name \'a\'')
+
+ p = gtest_test_utils.Subprocess(command)
+ Assert(p.terminated_by_signal)
+
+ # Check for appropriate output
+ Assert(err in p.output)
+
+
+class GTestParamTestInvalidName2Test(gtest_test_utils.TestCase):
+
+ def testExitCodeAndOutput(self):
+ TestExitCodeAndOutput(COMMAND)
+
+if __name__ == '__main__':
+ gtest_test_utils.Main()
diff --git a/googletest/test/googletest-param-test-invalid-name2-test_.cc b/googletest/test/googletest-param-test-invalid-name2-test_.cc
new file mode 100644
index 0000000..ef09349
--- /dev/null
+++ b/googletest/test/googletest-param-test-invalid-name2-test_.cc
@@ -0,0 +1,55 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#include "gtest/gtest.h"
+
+namespace {
+class DummyTest : public ::testing::TestWithParam<const char *> {};
+
+std::string StringParamTestSuffix(
+ const testing::TestParamInfo<const char*>& info) {
+ return std::string(info.param);
+}
+
+TEST_P(DummyTest, Dummy) {
+}
+
+INSTANTIATE_TEST_CASE_P(DuplicateTestNames,
+ DummyTest,
+ ::testing::Values("a", "b", "a", "c"),
+ StringParamTestSuffix);
+} // namespace
+
+int main(int argc, char *argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
+
diff --git a/googletest/test/gtest-param-test_test.cc b/googletest/test/googletest-param-test-test.cc
index adc4d1b..f789cab 100644
--- a/googletest/test/gtest-param-test_test.cc
+++ b/googletest/test/googletest-param-test-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. This file verifies that the parameter
// generators objects produce correct parameter sequences and that
@@ -43,7 +42,7 @@
# include <vector>
# include "src/gtest-internal-inl.h" // for UnitTestOptions
-# include "test/gtest-param-test_test.h"
+# include "test/googletest-param-test-test.h"
using ::std::vector;
using ::std::sort;
@@ -68,7 +67,7 @@ using ::testing::internal::UnitTestOptions;
// Prints a value to a string.
//
-// TODO(wan@google.com): remove PrintValue() when we move matchers and
+// FIXME: remove PrintValue() when we move matchers and
// EXPECT_THAT() from Google Mock to Google Test. At that time, we
// can write EXPECT_THAT(x, Eq(y)) to compare two tuples x and y, as
// EXPECT_THAT() and the matchers know how to print tuples.
diff --git a/googletest/test/gtest-param-test_test.h b/googletest/test/googletest-param-test-test.h
index ea1e884..632a61f 100644
--- a/googletest/test/gtest-param-test_test.h
+++ b/googletest/test/googletest-param-test-test.h
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev)
-//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file provides classes and functions used internally
diff --git a/googletest/test/gtest-param-test2_test.cc b/googletest/test/googletest-param-test2-test.cc
index c3b2d18..25bb945 100644
--- a/googletest/test/gtest-param-test2_test.cc
+++ b/googletest/test/googletest-param-test2-test.cc
@@ -26,35 +26,35 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
#include "gtest/gtest.h"
-#include "gtest-param-test_test.h"
+#include "test/googletest-param-test-test.h"
using ::testing::Values;
using ::testing::internal::ParamGenerator;
// Tests that generators defined in a different translation unit
// are functional. The test using extern_gen is defined
-// in gtest-param-test_test.cc.
+// in googletest-param-test-test.cc.
ParamGenerator<int> extern_gen = Values(33);
// Tests that a parameterized test case can be defined in one translation unit
-// and instantiated in another. The test is defined in gtest-param-test_test.cc
-// and ExternalInstantiationTest fixture class is defined in
-// gtest-param-test_test.h.
+// and instantiated in another. The test is defined in
+// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
+// defined in gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P(MultiplesOf33,
ExternalInstantiationTest,
Values(33, 66));
// Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined
-// in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest
-// fixture is defined in gtest-param-test_test.h
+// in googletest-param-test-test.cc and
+// InstantiationInMultipleTranslaionUnitsTest fixture is defined in
+// gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P(Sequence2,
InstantiationInMultipleTranslaionUnitsTest,
Values(42*3, 42*4, 42*5));
diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/googletest-port-test.cc
index 3801e5e..399316f 100644
--- a/googletest/test/gtest-port_test.cc
+++ b/googletest/test/googletest-port-test.cc
@@ -27,14 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
-//
// This file tests the internal cross-platform support utilities.
+#include <stdio.h>
#include "gtest/internal/gtest-port.h"
-#include <stdio.h>
-
#if GTEST_OS_MAC
# include <time.h>
#endif // GTEST_OS_MAC
@@ -227,7 +224,7 @@ TEST(ScopedPtrTest, DefinesElementType) {
StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
}
-// TODO(vladl@google.com): Implement THE REST of scoped_ptr tests.
+// FIXME: Implement THE REST of scoped_ptr tests.
TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
if (AlwaysFalse())
@@ -346,11 +343,11 @@ TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const bool a_false_condition = false;
const char regex[] =
#ifdef _MSC_VER
- "gtest-port_test\\.cc\\(\\d+\\):"
+ "googletest-port-test\\.cc\\(\\d+\\):"
#elif GTEST_USES_POSIX_RE
- "gtest-port_test\\.cc:[0-9]+"
+ "googletest-port-test\\.cc:[0-9]+"
#else
- "gtest-port_test\\.cc:\\d+"
+ "googletest-port-test\\.cc:\\d+"
#endif // _MSC_VER
".*a_false_condition.*Extra info.*";
diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/googletest-printers-test.cc
index 49b3bd4..ea8369d 100644
--- a/googletest/test/gtest-printers_test.cc
+++ b/googletest/test/googletest-printers-test.cc
@@ -26,15 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Google Test - The Google C++ Testing and Mocking Framework
//
// This file tests the universal value printer.
-#include "gtest/gtest-printers.h"
-
#include <ctype.h>
#include <limits.h>
#include <string.h>
@@ -48,6 +45,7 @@
#include <utility>
#include <vector>
+#include "gtest/gtest-printers.h"
#include "gtest/gtest.h"
#if GTEST_HAS_UNORDERED_MAP_
@@ -572,7 +570,7 @@ struct Foo {
TEST(PrintPointerTest, MemberVariablePointer) {
EXPECT_TRUE(HasPrefix(Print(&Foo::value),
Print(sizeof(&Foo::value)) + "-byte object "));
- int (Foo::*p) = NULL; // NOLINT
+ int Foo::*p = NULL; // NOLINT
EXPECT_TRUE(HasPrefix(Print(p),
Print(sizeof(p)) + "-byte object "));
}
@@ -920,8 +918,6 @@ TEST(PrintStlContainerTest, MultiSet) {
}
#if GTEST_HAS_STD_FORWARD_LIST_
-// <slist> is available on Linux in the google3 mode, but not on
-// Windows or Mac OS X.
TEST(PrintStlContainerTest, SinglyLinkedList) {
int a[] = { 9, 2, 8 };
@@ -1250,7 +1246,7 @@ TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
// Tests that the universal printer prints a member variable pointer
// passed by reference.
TEST(PrintReferenceTest, HandlesMemberVariablePointer) {
- int (Foo::*p) = &Foo::value; // NOLINT
+ int Foo::*p = &Foo::value; // NOLINT
EXPECT_TRUE(HasPrefix(
PrintByRef(p),
"@" + PrintPointer(&p) + " " + Print(sizeof(p)) + "-byte object "));
@@ -1731,6 +1727,21 @@ TEST(PrintOptionalTest, Basic) {
EXPECT_EQ("(1.1)", PrintToString(absl::optional<double>{1.1}));
EXPECT_EQ("(\"A\")", PrintToString(absl::optional<std::string>{"A"}));
}
+
+struct NonPrintable {
+ unsigned char contents = 17;
+};
+
+TEST(PrintOneofTest, Basic) {
+ using Type = absl::variant<int, StreamableInGlobal, NonPrintable>;
+ EXPECT_EQ("('int' with value 7)", PrintToString(Type(7)));
+ EXPECT_EQ("('StreamableInGlobal' with value StreamableInGlobal)",
+ PrintToString(Type(StreamableInGlobal{})));
+ EXPECT_EQ(
+ "('testing::gtest_printers_test::NonPrintable' with value 1-byte object "
+ "<11>)",
+ PrintToString(Type(NonPrintable{})));
+}
#endif // GTEST_HAS_ABSL
} // namespace gtest_printers_test
diff --git a/googletest/test/gtest_shuffle_test.py b/googletest/test/googletest-shuffle-test.py
index 30d0303..573cc5e 100755
--- a/googletest/test/gtest_shuffle_test.py
+++ b/googletest/test/googletest-shuffle-test.py
@@ -30,13 +30,11 @@
"""Verifies that test shuffling works."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
-# Command to run the gtest_shuffle_test_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_shuffle_test_')
+# Command to run the googletest-shuffle-test_ program.
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-shuffle-test_')
# The environment variables for test sharding.
TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
@@ -89,7 +87,7 @@ def GetTestsForAllIterations(extra_env, args):
Args:
extra_env: a map from environment variables to their values
- args: command line flags to pass to gtest_shuffle_test_
+ args: command line flags to pass to googletest-shuffle-test_
Returns:
A list where the i-th element is the list of tests run in the i-th
diff --git a/googletest/test/gtest_shuffle_test_.cc b/googletest/test/googletest-shuffle-test_.cc
index 6fb441b..1fe5f6a 100644
--- a/googletest/test/gtest_shuffle_test_.cc
+++ b/googletest/test/googletest-shuffle-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Verifies that test shuffling works.
diff --git a/googletest/test/gtest-test-part_test.cc b/googletest/test/googletest-test-part-test.cc
index ca8ba93..cd2d6f9 100644
--- a/googletest/test/gtest-test-part_test.cc
+++ b/googletest/test/googletest-test-part-test.cc
@@ -26,9 +26,6 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
-//
#include "gtest/gtest-test-part.h"
@@ -203,6 +200,6 @@ TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
}
-// TODO(mheule@google.com): Add a test for the class HasNewFatalFailureHelper.
+// FIXME: Add a test for the class HasNewFatalFailureHelper.
} // namespace
diff --git a/googletest/test/googletest-test2_test.cc b/googletest/test/googletest-test2_test.cc
new file mode 100644
index 0000000..c2f98dc
--- /dev/null
+++ b/googletest/test/googletest-test2_test.cc
@@ -0,0 +1,61 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//
+// Tests for Google Test itself. This verifies that the basic constructs of
+// Google Test work.
+
+#include "gtest/gtest.h"
+#include "googletest-param-test-test.h"
+
+using ::testing::Values;
+using ::testing::internal::ParamGenerator;
+
+// Tests that generators defined in a different translation unit
+// are functional. The test using extern_gen_2 is defined
+// in googletest-param-test-test.cc.
+ParamGenerator<int> extern_gen_2 = Values(33);
+
+// Tests that a parameterized test case can be defined in one translation unit
+// and instantiated in another. The test is defined in
+// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
+// defined in gtest-param-test_test.h.
+INSTANTIATE_TEST_CASE_P(MultiplesOf33,
+ ExternalInstantiationTest,
+ Values(33, 66));
+
+// Tests that a parameterized test case can be instantiated
+// in multiple translation units. Another instantiation is defined
+// in googletest-param-test-test.cc and
+// InstantiationInMultipleTranslaionUnitsTest fixture is defined in
+// gtest-param-test_test.h
+INSTANTIATE_TEST_CASE_P(Sequence2,
+ InstantiationInMultipleTranslaionUnitsTest,
+ Values(42*3, 42*4, 42*5));
+
diff --git a/googletest/test/gtest_throw_on_failure_test.py b/googletest/test/googletest-throw-on-failure-test.py
index 5678ffe..46cb9f6 100755
--- a/googletest/test/gtest_throw_on_failure_test.py
+++ b/googletest/test/googletest-throw-on-failure-test.py
@@ -31,12 +31,10 @@
"""Tests Google Test's throw-on-failure mode with exceptions disabled.
-This script invokes gtest_throw_on_failure_test_ (a program written with
+This script invokes googletest-throw-on-failure-test_ (a program written with
Google Test) with different environments and command line flags.
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import gtest_test_utils
@@ -46,10 +44,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling the throw-on-failure mode.
THROW_ON_FAILURE = 'gtest_throw_on_failure'
-# Path to the gtest_throw_on_failure_test_ program, compiled with
+# Path to the googletest-throw-on-failure-test_ program, compiled with
# exceptions disabled.
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_throw_on_failure_test_')
+ 'googletest-throw-on-failure-test_')
# Utilities.
@@ -75,13 +73,13 @@ def Run(command):
return p.exited and p.exit_code == 0
-# The tests. TODO(wan@google.com): refactor the class to share common
-# logic with code in gtest_break_on_failure_unittest.py.
+# The tests. FIXME: refactor the class to share common
+# logic with code in googletest-break-on-failure-unittest.py.
class ThrowOnFailureTest(gtest_test_utils.TestCase):
"""Tests the throw-on-failure mode."""
def RunAndVerify(self, env_var_value, flag_value, should_fail):
- """Runs gtest_throw_on_failure_test_ and verifies that it does
+ """Runs googletest-throw-on-failure-test_ and verifies that it does
(or does not) exit with a non-zero code.
Args:
diff --git a/googletest/test/gtest_throw_on_failure_test_.cc b/googletest/test/googletest-throw-on-failure-test_.cc
index 2b88fe3..f9a2c64 100644
--- a/googletest/test/gtest_throw_on_failure_test_.cc
+++ b/googletest/test/googletest-throw-on-failure-test_.cc
@@ -26,13 +26,12 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's throw-on-failure mode with exceptions disabled.
//
// This program must be compiled with exceptions disabled. It will be
-// invoked by gtest_throw_on_failure_test.py, and is expected to exit
+// invoked by googletest-throw-on-failure-test.py, and is expected to exit
// with non-zero in the throw-on-failure mode or 0 otherwise.
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest-tuple_test.cc b/googletest/test/googletest-tuple-test.cc
index bfaa3e0..dd82c16 100644
--- a/googletest/test/gtest-tuple_test.cc
+++ b/googletest/test/googletest-tuple-test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/internal/gtest-tuple.h"
#include <utility>
diff --git a/googletest/test/gtest_uninitialized_test.py b/googletest/test/googletest-uninitialized-test.py
index ae91f2a..5b7d1e7 100755
--- a/googletest/test/gtest_uninitialized_test.py
+++ b/googletest/test/googletest-uninitialized-test.py
@@ -31,11 +31,9 @@
"""Verifies that Google Test warns the user when not initialized properly."""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import gtest_test_utils
-COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')
+COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_')
def Assert(condition):
diff --git a/googletest/test/gtest_uninitialized_test_.cc b/googletest/test/googletest-uninitialized-test_.cc
index 2ba0e8b..b4434d5 100644
--- a/googletest/test/gtest_uninitialized_test_.cc
+++ b/googletest/test/googletest-uninitialized-test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest-typed-test2_test.cc b/googletest/test/gtest-typed-test2_test.cc
index ad77c65..ed96421 100644
--- a/googletest/test/gtest-typed-test2_test.cc
+++ b/googletest/test/gtest-typed-test2_test.cc
@@ -26,12 +26,11 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include <vector>
-#include "gtest-typed-test_test.h"
+#include "test/gtest-typed-test_test.h"
#include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P
diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc
index 5e1b7b2..eddb52b 100644
--- a/googletest/test/gtest-typed-test_test.cc
+++ b/googletest/test/gtest-typed-test_test.cc
@@ -26,10 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
-#include "gtest-typed-test_test.h"
+
+#include "test/gtest-typed-test_test.h"
#include <set>
#include <vector>
diff --git a/googletest/test/gtest-typed-test_test.h b/googletest/test/gtest-typed-test_test.h
index 41d7570..2cce67c 100644
--- a/googletest/test/gtest-typed-test_test.h
+++ b/googletest/test/gtest-typed-test_test.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
diff --git a/googletest/test/gtest-unittest-api_test.cc b/googletest/test/gtest-unittest-api_test.cc
index 1ebd431..f3ea03a 100644
--- a/googletest/test/gtest-unittest-api_test.cc
+++ b/googletest/test/gtest-unittest-api_test.cc
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: vladl@google.com (Vlad Losev)
+
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
diff --git a/googletest/test/gtest_all_test.cc b/googletest/test/gtest_all_test.cc
index e6c1b01..e61e36b 100644
--- a/googletest/test/gtest_all_test.cc
+++ b/googletest/test/gtest_all_test.cc
@@ -26,22 +26,21 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for Google C++ Testing and Mocking Framework (Google Test)
//
// Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose.
-#include "gtest-filepath_test.cc"
-#include "gtest-linked_ptr_test.cc"
-#include "gtest-message_test.cc"
-#include "gtest-options_test.cc"
-#include "gtest-port_test.cc"
-#include "gtest_pred_impl_unittest.cc"
-#include "gtest_prod_test.cc"
-#include "gtest-test-part_test.cc"
-#include "gtest-typed-test_test.cc"
-#include "gtest-typed-test2_test.cc"
-#include "gtest_unittest.cc"
-#include "production.cc"
+#include "test/googletest-filepath-test.cc"
+#include "test/googletest-linked-ptr-test.cc"
+#include "test/googletest-message-test.cc"
+#include "test/googletest-options-test.cc"
+#include "test/googletest-port-test.cc"
+#include "test/gtest_pred_impl_unittest.cc"
+#include "test/gtest_prod_test.cc"
+#include "test/googletest-test-part-test.cc"
+#include "test/gtest-typed-test_test.cc"
+#include "test/gtest-typed-test2_test.cc"
+#include "test/gtest_unittest.cc"
+#include "test/production.cc"
diff --git a/googletest/test/gtest_assert_by_exception_test.cc b/googletest/test/gtest_assert_by_exception_test.cc
index 2f0e34a..0eae857 100644
--- a/googletest/test/gtest_assert_by_exception_test.cc
+++ b/googletest/test/gtest_assert_by_exception_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's assert-by-exception mode with exceptions enabled.
@@ -98,7 +97,7 @@ TEST(Test, Test) {
int kTestForContinuingTest = 0;
TEST(Test, Test2) {
- // FIXME(sokolov): how to force Test2 to be after Test?
+ // FIXME: how to force Test2 to be after Test?
kTestForContinuingTest = 1;
}
diff --git a/googletest/test/gtest_environment_test.cc b/googletest/test/gtest_environment_test.cc
index 1d6dc12..bc9524d 100644
--- a/googletest/test/gtest_environment_test.cc
+++ b/googletest/test/gtest_environment_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests using global test environments.
diff --git a/googletest/test/gtest_help_test.py b/googletest/test/gtest_help_test.py
index 79ffbe4..582d24c 100755
--- a/googletest/test/gtest_help_test.py
+++ b/googletest/test/gtest_help_test.py
@@ -37,8 +37,6 @@ SYNOPSIS
gtest_help_test.py
"""
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import re
import gtest_test_utils
diff --git a/googletest/test/gtest_help_test_.cc b/googletest/test/gtest_help_test_.cc
index 31f78c2..750ae6c 100644
--- a/googletest/test/gtest_help_test_.cc
+++ b/googletest/test/gtest_help_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// This program is meant to be run by gtest_help_test.py. Do not run
// it directly.
diff --git a/googletest/test/gtest_main_unittest.cc b/googletest/test/gtest_main_unittest.cc
index c979fce..eddedea 100644
--- a/googletest/test/gtest_main_unittest.cc
+++ b/googletest/test/gtest_main_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_no_test_unittest.cc b/googletest/test/gtest_no_test_unittest.cc
index 292599a..d4f88db 100644
--- a/googletest/test/gtest_no_test_unittest.cc
+++ b/googletest/test/gtest_no_test_unittest.cc
@@ -29,8 +29,6 @@
// Tests that a Google Test program that has no test defined can run
// successfully.
-//
-// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_premature_exit_test.cc b/googletest/test/gtest_premature_exit_test.cc
index 3b4dc7d..c1e9305 100644
--- a/googletest/test/gtest_premature_exit_test.cc
+++ b/googletest/test/gtest_premature_exit_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests that Google Test manipulates the premature-exit-detection
// file correctly.
diff --git a/googletest/test/gtest_prod_test.cc b/googletest/test/gtest_prod_test.cc
index dfb9998..ede81a0 100644
--- a/googletest/test/gtest_prod_test.cc
+++ b/googletest/test/gtest_prod_test.cc
@@ -26,10 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Unit test for gtest/gtest_prod.h.
+// Unit test for gtest_prod.h.
#include "production.h"
#include "gtest/gtest.h"
diff --git a/googletest/test/gtest_repeat_test.cc b/googletest/test/gtest_repeat_test.cc
index 3171604..1e8f499 100644
--- a/googletest/test/gtest_repeat_test.cc
+++ b/googletest/test/gtest_repeat_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests the --gtest_repeat=number flag.
@@ -118,8 +117,7 @@ const int kNumberOfParamTests = 10;
class MyParamTest : public testing::TestWithParam<int> {};
TEST_P(MyParamTest, ShouldPass) {
- // TODO(vladl@google.com): Make parameter value checking robust
- // WRT order of tests.
+ // FIXME: Make parameter value checking robust WRT order of tests.
GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
g_param_test_count++;
}
diff --git a/googletest/test/gtest_sole_header_test.cc b/googletest/test/gtest_sole_header_test.cc
index ccd091a..1d94ac6 100644
--- a/googletest/test/gtest_sole_header_test.cc
+++ b/googletest/test/gtest_sole_header_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mheule@google.com (Markus Heule)
+
//
// This test verifies that it's possible to use Google Test by including
// the gtest.h header file alone.
diff --git a/googletest/test/gtest_stress_test.cc b/googletest/test/gtest_stress_test.cc
index cac405f..95ada39 100644
--- a/googletest/test/gtest_stress_test.cc
+++ b/googletest/test/gtest_stress_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently.
diff --git a/googletest/test/gtest_test_macro_stack_footprint_test.cc b/googletest/test/gtest_test_macro_stack_footprint_test.cc
new file mode 100644
index 0000000..a48db05
--- /dev/null
+++ b/googletest/test/gtest_test_macro_stack_footprint_test.cc
@@ -0,0 +1,89 @@
+// Copyright 2013, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//
+// Each TEST() expands to some static registration logic. GCC puts all
+// such static initialization logic for a translation unit in a common,
+// internal function. Since Google's build system restricts how much
+// stack space a function can use, there's a limit on how many TEST()s
+// one can put in a single C++ test file. This test ensures that a large
+// number of TEST()s can be defined in the same translation unit.
+
+#include "gtest/gtest.h"
+
+// This macro defines 10 dummy tests.
+#define TEN_TESTS_(test_case_name) \
+ TEST(test_case_name, T0) {} \
+ TEST(test_case_name, T1) {} \
+ TEST(test_case_name, T2) {} \
+ TEST(test_case_name, T3) {} \
+ TEST(test_case_name, T4) {} \
+ TEST(test_case_name, T5) {} \
+ TEST(test_case_name, T6) {} \
+ TEST(test_case_name, T7) {} \
+ TEST(test_case_name, T8) {} \
+ TEST(test_case_name, T9) {}
+
+// This macro defines 100 dummy tests.
+#define HUNDRED_TESTS_(test_case_name_prefix) \
+ TEN_TESTS_(test_case_name_prefix ## 0) \
+ TEN_TESTS_(test_case_name_prefix ## 1) \
+ TEN_TESTS_(test_case_name_prefix ## 2) \
+ TEN_TESTS_(test_case_name_prefix ## 3) \
+ TEN_TESTS_(test_case_name_prefix ## 4) \
+ TEN_TESTS_(test_case_name_prefix ## 5) \
+ TEN_TESTS_(test_case_name_prefix ## 6) \
+ TEN_TESTS_(test_case_name_prefix ## 7) \
+ TEN_TESTS_(test_case_name_prefix ## 8) \
+ TEN_TESTS_(test_case_name_prefix ## 9)
+
+// This macro defines 1000 dummy tests.
+#define THOUSAND_TESTS_(test_case_name_prefix) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 0) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 1) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 2) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 3) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 4) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 5) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 6) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 7) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 8) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 9)
+
+// Ensures that we can define 1000 TEST()s in the same translation
+// unit.
+THOUSAND_TESTS_(T)
+
+int main(int argc, char **argv) {
+ testing::InitGoogleTest(&argc, argv);
+
+ // We don't actually need to run the dummy tests - the purpose is to
+ // ensure that they compile.
+ return 0;
+}
diff --git a/googletest/test/gtest_test_utils.py b/googletest/test/gtest_test_utils.py
index d7fc099..43cba8f 100755
--- a/googletest/test/gtest_test_utils.py
+++ b/googletest/test/gtest_test_utils.py
@@ -31,20 +31,16 @@
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
-__author__ = 'wan@google.com (Zhanyong Wan)'
-
import os
import sys
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
import atexit
import shutil
import tempfile
-import unittest
-_test_module = unittest
+import unittest as _test_module
try:
import subprocess
@@ -74,7 +70,7 @@ def SetEnvVar(env_var, value):
# Here we expose a class from a particular module, depending on the
# environment. The comment suppresses the 'Invalid variable name' lint
# complaint.
-TestCase = _test_module.TestCase # pylint: disable-msg=C6409
+TestCase = _test_module.TestCase # pylint: disable=C6409
# Initially maps a flag to its default value. After
# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
@@ -88,7 +84,7 @@ def _ParseAndStripGTestFlags(argv):
# Suppresses the lint complaint about a global variable since we need it
# here to maintain module-wide state.
- global _gtest_flags_are_parsed # pylint: disable-msg=W0603
+ global _gtest_flags_are_parsed # pylint: disable=W0603
if _gtest_flags_are_parsed:
return
@@ -310,7 +306,7 @@ def Main():
_ParseAndStripGTestFlags(sys.argv)
# The tested binaries should not be writing XML output files unless the
# script explicitly instructs them to.
- # TODO(vladl@google.com): Move this into Subprocess when we implement
+ # FIXME: Move this into Subprocess when we implement
# passing environment into it as a parameter.
if GTEST_OUTPUT_VAR_NAME in os.environ:
del os.environ[GTEST_OUTPUT_VAR_NAME]
diff --git a/googletest/test/gtest_testbridge_test.py b/googletest/test/gtest_testbridge_test.py
index 2075e12..87ffad7 100644..100755
--- a/googletest/test/gtest_testbridge_test.py
+++ b/googletest/test/gtest_testbridge_test.py
@@ -29,8 +29,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Verifies that Google Test uses filter provided via testbridge."""
-__author__ = 'rfj@google.com (Rohan Joyce)'
-
import os
import gtest_test_utils
diff --git a/googletest/test/gtest_testbridge_test_.cc b/googletest/test/gtest_testbridge_test_.cc
index 0bb069e..24617b2 100644
--- a/googletest/test/gtest_testbridge_test_.cc
+++ b/googletest/test/gtest_testbridge_test_.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: rfj@google.com (Rohan Joyce)
+
// This program is meant to be run by gtest_test_filter_test.py. Do not run
// it directly.
diff --git a/googletest/test/gtest_throw_on_failure_ex_test.cc b/googletest/test/gtest_throw_on_failure_ex_test.cc
index 8d46c76..93f59d4 100644
--- a/googletest/test/gtest_throw_on_failure_ex_test.cc
+++ b/googletest/test/gtest_throw_on_failure_ex_test.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests Google Test's throw-on-failure mode with exceptions enabled.
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 39b6841..e1c30f3 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
@@ -35,8 +34,8 @@
#include "gtest/gtest.h"
// Verifies that the command line flag variables can be accessed in
-// code once "gtest/gtest.h" has been
-// #included. Do not move it after other gtest #includes.
+// code once "gtest.h" has been #included.
+// Do not move it after other gtest #includes.
TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
|| testing::GTEST_FLAG(break_on_failure)
@@ -444,10 +443,10 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test {
virtual void SetUp() {
saved_tz_ = NULL;
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* getenv, strdup: deprecated */)
+ GTEST_DISABLE_MSC_DEPRECATED_PUSH_(/* getenv, strdup: deprecated */)
if (getenv("TZ"))
saved_tz_ = strdup(getenv("TZ"));
- GTEST_DISABLE_MSC_WARNINGS_POP_()
+ GTEST_DISABLE_MSC_DEPRECATED_POP_()
// Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We
// cannot use the local time zone because the function's output depends
@@ -1385,8 +1384,7 @@ class TestResultTest : public Test {
// In order to test TestResult, we need to modify its internal
// state, in particular the TestPartResult vector it holds.
// test_part_results() returns a const reference to this vector.
- // We cast it to a non-const object s.t. it can be modified (yes,
- // this is a hack).
+ // We cast it to a non-const object s.t. it can be modified
TPRVector* results1 = const_cast<TPRVector*>(
&TestResultAccessor::test_part_results(*r1));
TPRVector* results2 = const_cast<TPRVector*>(
@@ -4689,7 +4687,7 @@ TEST(MacroTest, ADD_FAILURE_AT) {
// Unfortunately, we cannot verify that the failure message contains
// the right file path and line number the same way, as
// EXPECT_NONFATAL_FAILURE() doesn't get to see the file path and
- // line number. Instead, we do that in gtest_output_test_.cc.
+ // line number. Instead, we do that in googletest-output-test_.cc.
}
// Tests FAIL.
@@ -7373,7 +7371,7 @@ GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
// Tests for internal utilities necessary for implementation of the universal
// printing.
-// TODO(vladl@google.com): Find a better home for them.
+// FIXME: Find a better home for them.
class ConversionHelperBase {};
class ConversionHelperDerived : public ConversionHelperBase {};
diff --git a/googletest/test/gtest_xml_outfile1_test_.cc b/googletest/test/gtest_xml_outfile1_test_.cc
index e3d1dd1..a38ebac 100644
--- a/googletest/test/gtest_xml_outfile1_test_.cc
+++ b/googletest/test/gtest_xml_outfile1_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// gtest_xml_outfile1_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_outfile2_test_.cc b/googletest/test/gtest_xml_outfile2_test_.cc
index 55eb8f3..afaf15a 100644
--- a/googletest/test/gtest_xml_outfile2_test_.cc
+++ b/googletest/test/gtest_xml_outfile2_test_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-//
// gtest_xml_outfile2_test_ writes some xml via TestProperty used by
// gtest_xml_outfiles_test.py
diff --git a/googletest/test/gtest_xml_outfiles_test.py b/googletest/test/gtest_xml_outfiles_test.py
index c7d3413..2c031ff 100755
--- a/googletest/test/gtest_xml_outfiles_test.py
+++ b/googletest/test/gtest_xml_outfiles_test.py
@@ -111,11 +111,11 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
self.assert_(p.exited)
self.assertEquals(0, p.exit_code)
- # TODO(wan@google.com): libtool causes the built test binary to be
+ # FIXME: libtool causes the built test binary to be
# named lt-gtest_xml_outfiles_test_ instead of
# gtest_xml_outfiles_test_. To account for this possibility, we
# allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
+ # when libtool replacement tool is ready.
output_file_name1 = test_name + ".xml"
output_file1 = os.path.join(self.output_dir_, output_file_name1)
output_file_name2 = 'lt-' + output_file_name1
diff --git a/googletest/test/gtest_xml_output_unittest.py b/googletest/test/gtest_xml_output_unittest.py
index 6ffb6e3..faedd4e 100755
--- a/googletest/test/gtest_xml_output_unittest.py
+++ b/googletest/test/gtest_xml_output_unittest.py
@@ -47,17 +47,22 @@ GTEST_OUTPUT_FLAG = '--gtest_output'
GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_'
+# The flag indicating stacktraces are not supported
+NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
+
# The environment variables for test sharding.
TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
SHARD_STATUS_FILE_ENV_VAR = 'GTEST_SHARD_STATUS_FILE'
-SUPPORTS_STACK_TRACES = False
+SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
if SUPPORTS_STACK_TRACES:
STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
else:
STACK_TRACE_TEMPLATE = ''
+ # unittest.main() can't handle unknown flags
+ sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
EXPECTED_NON_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="23" failures="4" disabled="2" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42">
diff --git a/googletest/test/production.cc b/googletest/test/production.cc
index 006bb97..0f69f6d 100644
--- a/googletest/test/production.cc
+++ b/googletest/test/production.cc
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// This is part of the unit test for gtest_prod.h.
diff --git a/googletest/test/production.h b/googletest/test/production.h
index 0f01d83..542723b 100644
--- a/googletest/test/production.h
+++ b/googletest/test/production.h
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
//
// This is part of the unit test for gtest_prod.h.