summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorTanzinul Islam <t_17_7@hotmail.com>2018-08-01 21:48:05 (GMT)
committerTanzinul Islam <t_17_7@hotmail.com>2018-08-01 21:48:05 (GMT)
commit1cd979a80701a6c8c370f3a69048ba5cbec62a28 (patch)
tree5358fa1f0e6726c0b9a77b985d26f7b431b663b9 /googletest/test
parent3280099951c51b7d2745bd840f2dd9d967cffcda (diff)
parente5e2ef7cd27cc089c1d8302a11970ef870554294 (diff)
downloadgoogletest-1cd979a80701a6c8c370f3a69048ba5cbec62a28.zip
googletest-1cd979a80701a6c8c370f3a69048ba5cbec62a28.tar.gz
googletest-1cd979a80701a6c8c370f3a69048ba5cbec62a28.tar.bz2
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/BUILD.bazel86
-rw-r--r--googletest/test/gtest-death-test_test.cc2
-rw-r--r--googletest/test/gtest-listener_test.cc2
-rw-r--r--googletest/test/gtest-param-test_test.h2
-rw-r--r--googletest/test/gtest-printers_test.cc8
-rw-r--r--googletest/test/gtest-unittest-api_test.cc2
-rw-r--r--googletest/test/gtest_all_test.cc2
-rwxr-xr-xgoogletest/test/gtest_help_test.py2
-rwxr-xr-xgoogletest/test/gtest_output_test.py16
-rw-r--r--googletest/test/gtest_output_test_golden_lin.txt222
-rw-r--r--googletest/test/gtest_prod_test.cc2
-rw-r--r--googletest/test/gtest_test_macro_stack_footprint_test.cc90
-rwxr-xr-xgoogletest/test/gtest_test_utils.py2
-rw-r--r--googletest/test/gtest_testbridge_test.py65
-rw-r--r--googletest/test/gtest_testbridge_test_.cc44
-rw-r--r--googletest/test/gtest_unittest.cc29
-rwxr-xr-xgoogletest/test/gtest_xml_output_unittest.py7
17 files changed, 543 insertions, 40 deletions
diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel
index 6ea18ec..6888e4c 100644
--- a/googletest/test/BUILD.bazel
+++ b/googletest/test/BUILD.bazel
@@ -34,35 +34,48 @@
licenses(["notice"])
-""" gtest own tests """
+config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+)
+
+config_setting(
+ name = "windows_msvc",
+ values = {"cpu": "x64_windows_msvc"},
+)
+
+config_setting(
+ name = "has_absl",
+ values = {"define": "absl=1"},
+)
#on windows exclude gtest-tuple.h and gtest-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",
+ "*.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({
"//:windows": [],
"//:windows_msvc": [],
"//conditions:default": [
"gtest-tuple_test.cc",
],
- }),
+ }),
copts = select({
"//:windows": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
"//:windows_msvc": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
@@ -84,6 +97,14 @@ cc_test(
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",
@@ -135,7 +156,6 @@ py_library(
name = "gtest_test_utils",
testonly = 1,
srcs = ["gtest_test_utils.py"],
-
)
cc_binary(
@@ -144,6 +164,7 @@ cc_binary(
srcs = ["gtest_help_test_.cc"],
deps = ["//:gtest_main"],
)
+
py_test(
name = "gtest_help_test",
size = "small",
@@ -163,6 +184,10 @@ py_test(
name = "gtest_output_test",
size = "small",
srcs = ["gtest_output_test.py"],
+ args = select({
+ ":has_absl": [],
+ "//conditions:default": ["--no_stacktrace_support"],
+ }),
data = [
"gtest_output_test_golden_lin.txt",
":gtest_output_test_",
@@ -176,6 +201,7 @@ cc_binary(
srcs = ["gtest_color_test_.cc"],
deps = ["//:gtest"],
)
+
py_test(
name = "gtest_color_test",
size = "small",
@@ -327,6 +353,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.
@@ -378,3 +408,19 @@ py_test(
data = [":gtest_uninitialized_test_"],
deps = [":gtest_test_utils"],
)
+
+cc_binary(
+ name = "gtest_testbridge_test_",
+ testonly = 1,
+ srcs = ["gtest_testbridge_test_.cc"],
+ deps = ["//:gtest_main"],
+)
+
+# Tests that filtering via testbridge works
+py_test(
+ name = "gtest_testbridge_test",
+ size = "small",
+ srcs = ["gtest_testbridge_test.py"],
+ data = [":gtest_testbridge_test_"],
+ deps = [":gtest_test_utils"],
+)
diff --git a/googletest/test/gtest-death-test_test.cc b/googletest/test/gtest-death-test_test.cc
index 37261cb..9d8f13c 100644
--- a/googletest/test/gtest-death-test_test.cc
+++ b/googletest/test/gtest-death-test_test.cc
@@ -784,7 +784,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
diff --git a/googletest/test/gtest-listener_test.cc b/googletest/test/gtest-listener_test.cc
index 9074768..639529c 100644
--- a/googletest/test/gtest-listener_test.cc
+++ b/googletest/test/gtest-listener_test.cc
@@ -28,7 +28,7 @@
//
// Author: vladl@google.com (Vlad Losev)
//
-// The Google C++ Testing Framework (Google Test)
+// The Google C++ Testing and Mocking Framework (Google Test)
//
// This file verifies Google Test event listeners receive events at the
// right times.
diff --git a/googletest/test/gtest-param-test_test.h b/googletest/test/gtest-param-test_test.h
index 249c089..ea1e884 100644
--- a/googletest/test/gtest-param-test_test.h
+++ b/googletest/test/gtest-param-test_test.h
@@ -29,7 +29,7 @@
//
// Authors: vladl@google.com (Vlad Losev)
//
-// The Google C++ Testing Framework (Google Test)
+// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file provides classes and functions used internally
// for testing Google Test itself.
diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/gtest-printers_test.cc
index 4487978..49b3bd4 100644
--- a/googletest/test/gtest-printers_test.cc
+++ b/googletest/test/gtest-printers_test.cc
@@ -29,7 +29,7 @@
//
// Author: wan@google.com (Zhanyong Wan)
-// Google Test - The Google C++ Testing Framework
+// Google Test - The Google C++ Testing and Mocking Framework
//
// This file tests the universal value printer.
@@ -1115,6 +1115,12 @@ TEST(PrintStdTupleTest, NestedTuple) {
#endif // GTEST_LANG_CXX11
+#if GTEST_LANG_CXX11
+TEST(PrintNullptrT, Basic) {
+ EXPECT_EQ("(nullptr)", Print(nullptr));
+}
+#endif // GTEST_LANG_CXX11
+
// Tests printing user-defined unprintable types.
// Unprintable types in the global namespace.
diff --git a/googletest/test/gtest-unittest-api_test.cc b/googletest/test/gtest-unittest-api_test.cc
index b1f5168..1ebd431 100644
--- a/googletest/test/gtest-unittest-api_test.cc
+++ b/googletest/test/gtest-unittest-api_test.cc
@@ -28,7 +28,7 @@
//
// Author: vladl@google.com (Vlad Losev)
//
-// The Google C++ Testing Framework (Google Test)
+// The Google C++ Testing and Mocking Framework (Google Test)
//
// This file contains tests verifying correctness of data provided via
// UnitTest's public methods.
diff --git a/googletest/test/gtest_all_test.cc b/googletest/test/gtest_all_test.cc
index e16ef53..e6c1b01 100644
--- a/googletest/test/gtest_all_test.cc
+++ b/googletest/test/gtest_all_test.cc
@@ -29,7 +29,7 @@
//
// Author: wan@google.com (Zhanyong Wan)
//
-// Tests for Google C++ Testing Framework (Google Test)
+// 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.
diff --git a/googletest/test/gtest_help_test.py b/googletest/test/gtest_help_test.py
index 093c838..79ffbe4 100755
--- a/googletest/test/gtest_help_test.py
+++ b/googletest/test/gtest_help_test.py
@@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests the --help flag of Google C++ Testing Framework.
+"""Tests the --help flag of Google C++ Testing and Mocking Framework.
SYNOPSIS
gtest_help_test.py --build_dir=BUILD/DIR
diff --git a/googletest/test/gtest_output_test.py b/googletest/test/gtest_output_test.py
index e431653..63763b9 100755
--- a/googletest/test/gtest_output_test.py
+++ b/googletest/test/gtest_output_test.py
@@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests the text output of Google C++ Testing Framework.
+"""Tests the text output of Google C++ Testing and Mocking Framework.
SYNOPSIS
@@ -52,6 +52,9 @@ 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'
@@ -252,13 +255,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):
@@ -325,7 +327,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
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_golden_lin.txt b/googletest/test/gtest_output_test_golden_lin.txt
index cbcb720..02a77a8 100644
--- a/googletest/test/gtest_output_test_golden_lin.txt
+++ b/googletest/test/gtest_output_test_golden_lin.txt
@@ -4,10 +4,14 @@ gtest_output_test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
+Stack trace: (omitted)
+
gtest_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.
@@ -40,12 +44,16 @@ Expected equality of these values:
Which is: "\"Line"
actual
Which is: "actual \"string\""
+Stack trace: (omitted)
+
gtest_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
@@ -58,6 +66,8 @@ With diff:
-\"Line\0 1\"
Line 2
+Stack trace: (omitted)
+
[ FAILED ] NonfatalFailureTest.DiffForLongStrings
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
@@ -67,6 +77,8 @@ 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)
@@ -75,6 +87,8 @@ Expected equality of these values:
1
x
Which is: 2
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
@@ -82,6 +96,8 @@ gtest_output_test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
[----------] 1 test from LoggingTest
[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
@@ -90,10 +106,14 @@ i == 0
i == 1
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
+Stack trace: (omitted)
+
i == 2
i == 3
gtest_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
@@ -105,20 +125,28 @@ gtest_output_test_.cc:#: (null)
gtest_output_test_.cc:#: 1337
gtest_output_test_.cc:#: std::string
gtest_output_test_.cc:#: literal string
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.AcceptedValues
[ RUN ] SCOPED_TRACETest.ObeysScopes
(expected to fail)
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and shouldn't have a trace.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should have a trace.
Google Test trace:
gtest_output_test_.cc:#: Expected trace
+Stack trace: (omitted)
+
gtest_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)
@@ -129,6 +157,8 @@ Expected equality of these values:
Which is: 1
Google Test trace:
gtest_output_test_.cc:#: i = 1
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Expected equality of these values:
1
@@ -136,6 +166,8 @@ Expected equality of these values:
Which is: 2
Google Test trace:
gtest_output_test_.cc:#: i = 2
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine
(expected to fail)
@@ -146,6 +178,8 @@ Expected equality of these values:
Which is: 1
Google Test trace:
gtest_output_test_.cc:#: n = 1
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Expected equality of these values:
1
@@ -153,6 +187,8 @@ Expected equality of these values:
Which is: 2
Google Test trace:
gtest_output_test_.cc:#: n = 2
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested
(expected to fail)
@@ -164,6 +200,8 @@ Expected equality of these values:
Google Test trace:
gtest_output_test_.cc:#: n = 2
gtest_output_test_.cc:#:
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.CanBeNested
[ RUN ] SCOPED_TRACETest.CanBeRepeated
(expected to fail)
@@ -172,12 +210,16 @@ Failed
This failure is expected, and should contain trace point A.
Google Test trace:
gtest_output_test_.cc:#: A
+Stack trace: (omitted)
+
gtest_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
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and C.
@@ -185,6 +227,8 @@ Google Test trace:
gtest_output_test_.cc:#: C
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and D.
@@ -192,6 +236,8 @@ Google Test trace:
gtest_output_test_.cc:#: D
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
+Stack trace: (omitted)
+
[ FAILED ] SCOPED_TRACETest.CanBeRepeated
[ RUN ] SCOPED_TRACETest.WorksConcurrently
(expecting 6 failures)
@@ -200,27 +246,39 @@ Failed
Expected failure #1 (in thread B, only trace B alive).
Google Test trace:
gtest_output_test_.cc:#: Trace B
+Stack trace: (omitted)
+
gtest_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
+Stack trace: (omitted)
+
gtest_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
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #4 (in thread B, only trace A alive).
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #5 (in thread A, only trace A alive).
Google Test trace:
gtest_output_test_.cc:#: Trace A
+Stack trace: (omitted)
+
gtest_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
@@ -229,6 +287,8 @@ 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
@@ -236,18 +296,28 @@ explicit_file.cc:123: expected trace message
gtest_output_test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #2, in SetUp().
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #3, in the test body.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #4, in TearDown.
+Stack trace: (omitted)
+
gtest_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
@@ -255,9 +325,13 @@ Expected failure #5, in the test fixture d'tor.
gtest_output_test_.cc:#: Failure
Failed
Expected failure #1, in the test fixture c'tor.
+Stack trace: (omitted)
+
gtest_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
@@ -265,15 +339,23 @@ Expected failure #2, in the test fixture d'tor.
gtest_output_test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #2, in the test function.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #3, in TearDown().
+Stack trace: (omitted)
+
gtest_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
@@ -281,18 +363,26 @@ Expected failure #4, in the test fixture d'tor.
gtest_output_test_.cc:#: Failure
Failed
Expected failure #1, in SetUp().
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Failure
Failed
Expected failure #2, in TearDown().
+Stack trace: (omitted)
+
gtest_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,6 +475,8 @@ case.
gtest.cc:#: Failure
Expected: 1 non-fatal failure
Actual: 0 failures
+Stack trace: (omitted)
+
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
(expecting a failure)
@@ -384,10 +486,16 @@ Expected: 1 non-fatal failure
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 1.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure 2.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
@@ -398,6 +506,10 @@ Expected: 1 non-fatal failure
gtest_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,6 +540,8 @@ 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)
@@ -433,10 +551,16 @@ Expected: 1 fatal failure
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
@@ -447,6 +571,10 @@ Expected: 1 fatal failure
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenStatementReturns
@@ -454,12 +582,16 @@ 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
@@ -471,6 +603,8 @@ Expected equality of these values:
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
@@ -483,8 +617,10 @@ Expected equality of these values:
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
@@ -495,7 +631,9 @@ Expected equality of these values:
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)
@@ -504,6 +642,10 @@ Expected: 1 fatal failure
Actual:
gtest_output_test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -512,6 +654,10 @@ Expected: 1 fatal failure
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -520,6 +666,10 @@ Expected: 1 fatal failure containing "Some other fatal failure expected."
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectFatalFailure
[ RUN ] ExpectFailureTest.ExpectNonFatalFailure
@@ -529,6 +679,10 @@ Expected: 1 non-fatal failure
Actual:
gtest_output_test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -537,6 +691,10 @@ Expected: 1 non-fatal failure
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -545,6 +703,10 @@ Expected: 1 non-fatal failure containing "Some other non-fatal failure."
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
[ RUN ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
@@ -554,6 +716,10 @@ Expected: 1 fatal failure
Actual:
gtest_output_test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -562,6 +728,10 @@ Expected: 1 fatal failure
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -570,6 +740,10 @@ Expected: 1 fatal failure containing "Some other fatal failure expected."
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
[ RUN ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
@@ -579,6 +753,10 @@ Expected: 1 non-fatal failure
Actual:
gtest_output_test_.cc:#: Success:
Succeeded
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -587,6 +765,10 @@ Expected: 1 non-fatal failure
gtest_output_test_.cc:#: Fatal failure:
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
(expecting 1 failure)
gtest.cc:#: Failure
@@ -595,6 +777,10 @@ Expected: 1 non-fatal failure containing "Some other non-fatal failure."
gtest_output_test_.cc:#: Non-fatal failure:
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
+
+Stack trace: (omitted)
[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
[----------] 2 tests from ExpectFailureWithThreadsTest
@@ -603,18 +789,26 @@ Expected non-fatal failure.
gtest_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
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
@@ -622,9 +816,13 @@ Expected: 1 non-fatal failure
gtest_output_test_.cc:#: Failure
Failed
Expected fatal failure.
+Stack trace: (omitted)
+
gtest_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
@@ -633,6 +831,8 @@ 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
@@ -644,16 +844,22 @@ Expected equality of these values:
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
Failed
Expected non-fatal failure.
+Stack trace: (omitted)
+
FooEnvironment::TearDown() called.
gtest_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
@@ -718,6 +924,8 @@ 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)
@@ -726,6 +934,8 @@ 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)
@@ -733,6 +943,8 @@ gtest_output_test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
+Stack trace: (omitted)
+
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
[----------] 3 tests from FatalFailureTest (? ms total)
@@ -743,10 +955,14 @@ i == 0
i == 1
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
+Stack trace: (omitted)
+
i == 2
i == 3
gtest_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_prod_test.cc b/googletest/test/gtest_prod_test.cc
index dfb9998..c5cceab 100644
--- a/googletest/test/gtest_prod_test.cc
+++ b/googletest/test/gtest_prod_test.cc
@@ -29,7 +29,7 @@
//
// 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_test_macro_stack_footprint_test.cc b/googletest/test/gtest_test_macro_stack_footprint_test.cc
new file mode 100644
index 0000000..48958b8
--- /dev/null
+++ b/googletest/test/gtest_test_macro_stack_footprint_test.cc
@@ -0,0 +1,90 @@
+// Copyright 2013, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Author: wan@google.com (Zhanyong Wan)
+//
+// Each TEST() expands to some static registration logic. GCC puts all
+// such static initialization logic for a translation unit in a common,
+// internal function. Since Google's build system restricts how much
+// stack space a function can use, there's a limit on how many TEST()s
+// one can put in a single C++ test file. This test ensures that a large
+// number of TEST()s can be defined in the same translation unit.
+
+#include "gtest/gtest.h"
+
+// This macro defines 10 dummy tests.
+#define TEN_TESTS_(test_case_name) \
+ TEST(test_case_name, T0) {} \
+ TEST(test_case_name, T1) {} \
+ TEST(test_case_name, T2) {} \
+ TEST(test_case_name, T3) {} \
+ TEST(test_case_name, T4) {} \
+ TEST(test_case_name, T5) {} \
+ TEST(test_case_name, T6) {} \
+ TEST(test_case_name, T7) {} \
+ TEST(test_case_name, T8) {} \
+ TEST(test_case_name, T9) {}
+
+// This macro defines 100 dummy tests.
+#define HUNDRED_TESTS_(test_case_name_prefix) \
+ TEN_TESTS_(test_case_name_prefix ## 0) \
+ TEN_TESTS_(test_case_name_prefix ## 1) \
+ TEN_TESTS_(test_case_name_prefix ## 2) \
+ TEN_TESTS_(test_case_name_prefix ## 3) \
+ TEN_TESTS_(test_case_name_prefix ## 4) \
+ TEN_TESTS_(test_case_name_prefix ## 5) \
+ TEN_TESTS_(test_case_name_prefix ## 6) \
+ TEN_TESTS_(test_case_name_prefix ## 7) \
+ TEN_TESTS_(test_case_name_prefix ## 8) \
+ TEN_TESTS_(test_case_name_prefix ## 9)
+
+// This macro defines 1000 dummy tests.
+#define THOUSAND_TESTS_(test_case_name_prefix) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 0) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 1) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 2) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 3) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 4) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 5) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 6) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 7) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 8) \
+ HUNDRED_TESTS_(test_case_name_prefix ## 9)
+
+// Ensures that we can define 1000 TEST()s in the same translation
+// unit.
+THOUSAND_TESTS_(T)
+
+int main(int argc, char **argv) {
+ testing::InitGoogleTest(&argc, argv);
+
+ // We don't actually need to run the dummy tests - the purpose is to
+ // ensure that they compile.
+ return 0;
+}
diff --git a/googletest/test/gtest_test_utils.py b/googletest/test/gtest_test_utils.py
index 7c48933..d7fc099 100755
--- a/googletest/test/gtest_test_utils.py
+++ b/googletest/test/gtest_test_utils.py
@@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Unit test utilities for Google C++ Testing Framework."""
+"""Unit test utilities for Google C++ Testing and Mocking Framework."""
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
diff --git a/googletest/test/gtest_testbridge_test.py b/googletest/test/gtest_testbridge_test.py
new file mode 100644
index 0000000..2075e12
--- /dev/null
+++ b/googletest/test/gtest_testbridge_test.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# Copyright 2018 Google LLC. 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 uses filter provided via testbridge."""
+
+__author__ = 'rfj@google.com (Rohan Joyce)'
+
+import os
+
+import gtest_test_utils
+
+binary_name = 'gtest_testbridge_test_'
+COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
+TESTBRIDGE_NAME = 'TESTBRIDGE_TEST_ONLY'
+
+
+def Assert(condition):
+ if not condition:
+ raise AssertionError
+
+
+class GTestTestFilterTest(gtest_test_utils.TestCase):
+
+ def testTestExecutionIsFiltered(self):
+ """Tests that the test filter is picked up from the testbridge env var."""
+ subprocess_env = os.environ.copy()
+
+ subprocess_env[TESTBRIDGE_NAME] = '*.TestThatSucceeds'
+ p = gtest_test_utils.Subprocess(COMMAND, env=subprocess_env)
+
+ self.assertEquals(0, p.exit_code)
+
+ Assert('filter = *.TestThatSucceeds' in p.output)
+ Assert('[ OK ] TestFilterTest.TestThatSucceeds' in p.output)
+ Assert('[ PASSED ] 1 test.' in p.output)
+
+
+if __name__ == '__main__':
+ gtest_test_utils.Main()
diff --git a/googletest/test/gtest_testbridge_test_.cc b/googletest/test/gtest_testbridge_test_.cc
new file mode 100644
index 0000000..0bb069e
--- /dev/null
+++ b/googletest/test/gtest_testbridge_test_.cc
@@ -0,0 +1,44 @@
+// Copyright 2018, Google LLC.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Author: rfj@google.com (Rohan Joyce)
+
+// This program is meant to be run by gtest_test_filter_test.py. Do not run
+// it directly.
+
+#include "gtest/gtest.h"
+
+// These tests are used to detect if filtering is working. Only
+// 'TestThatSucceeds' should ever run.
+
+TEST(TestFilterTest, TestThatSucceeds) {}
+
+TEST(TestFilterTest, TestThatFails) {
+ ASSERT_TRUE(false) << "This test should never be run.";
+}
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 8dc8932..8ebb667 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -35,8 +35,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)
@@ -380,6 +380,31 @@ TEST(GetTestTypeIdTest, ReturnsTheSameValueInsideOrOutsideOfGoogleTest) {
EXPECT_EQ(kTestTypeIdInGoogleTest, GetTestTypeId());
}
+// Tests CanonicalizeForStdLibVersioning.
+
+using ::testing::internal::CanonicalizeForStdLibVersioning;
+
+TEST(CanonicalizeForStdLibVersioning, LeavesUnversionedNamesUnchanged) {
+ EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::bind"));
+ EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::_"));
+ EXPECT_EQ("std::__foo", CanonicalizeForStdLibVersioning("std::__foo"));
+ EXPECT_EQ("gtl::__1::x", CanonicalizeForStdLibVersioning("gtl::__1::x"));
+ EXPECT_EQ("__1::x", CanonicalizeForStdLibVersioning("__1::x"));
+ EXPECT_EQ("::__1::x", CanonicalizeForStdLibVersioning("::__1::x"));
+}
+
+TEST(CanonicalizeForStdLibVersioning, ElidesDoubleUnderNames) {
+ EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__1::bind"));
+ EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__1::_"));
+
+ EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__g::bind"));
+ EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__g::_"));
+
+ EXPECT_EQ("std::bind",
+ CanonicalizeForStdLibVersioning("std::__google::bind"));
+ EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__google::_"));
+}
+
// Tests FormatTimeInMillisAsSeconds().
TEST(FormatTimeInMillisAsSecondsTest, FormatsZero) {
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">