From 2cc008538c97189a5130a5598c62574c4972bef4 Mon Sep 17 00:00:00 2001 From: misterg Date: Tue, 28 Aug 2018 16:24:08 -0400 Subject: [PATCH 1/7] Googletest export Internal Change PiperOrigin-RevId: 210594341 --- googlemock/include/gmock/gmock-matchers.h | 7 +++---- googletest/test/googletest-output-test_.cc | 8 +------- googletest/test/gtest-typed-test_test.cc | 8 -------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 9cd1a065..3975cd07 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -56,9 +56,8 @@ # include // NOLINT -- must be after gtest.h #endif -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 5046 \ -/* class A needs to have dll-interface to be used by clients of class B */ \ -/* Symbol involving type with internal linkage not defined */) +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +/* class A needs to have dll-interface to be used by clients of class B */) namespace testing { @@ -5271,7 +5270,7 @@ PolymorphicMatcher > VariantWith( } // namespace testing -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046 +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 // Include any custom callback matchers added by the local installation. // We must include this header at the end to make sure it can use the diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index 180630e2..d6f7e0ba 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -39,10 +39,6 @@ #include -#if _MSC_VER - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */) -#endif // . _MSC_VER - #if GTEST_IS_THREADSAFE using testing::ScopedFakeTestPartResultReporter; using testing::TestPartResultArray; @@ -1102,8 +1098,6 @@ int main(int argc, char **argv) { // are registered, and torn down in the reverse order. testing::AddGlobalTestEnvironment(new FooEnvironment); testing::AddGlobalTestEnvironment(new BarEnvironment); -#if _MSC_VER - GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127 -#endif // . _MSC_VER + return RunAllTests(); } diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc index c38bb94a..e9eed639 100644 --- a/googletest/test/gtest-typed-test_test.cc +++ b/googletest/test/gtest-typed-test_test.cc @@ -35,10 +35,6 @@ #include "gtest/gtest.h" -#if _MSC_VER -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */) -#endif // _MSC_VER - using testing::Test; // Used for testing that SetUpTestCase()/TearDownTestCase(), fixture @@ -454,8 +450,4 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, TrimmedTest, TrimTypes); // must be defined). This dummy test keeps gtest_main linked in. TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {} -#if _MSC_VER -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127 -#endif // _MSC_VER - #endif // #if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P) From 00d1ffc8c85234fb8fe873d1591374289de1356d Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 29 Aug 2018 04:09:04 -0400 Subject: [PATCH 2/7] Googletest export Fix the typed test names in the tests for customized typed test parameters. As required by googletest documentation, the names should not contain an underscore. PiperOrigin-RevId: 210678652 --- googletest/include/gtest/gtest-typed-test.h | 2 +- googletest/test/googletest-output-test_.cc | 8 ++++---- googletest/test/gtest-typed-test_test.cc | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index 29b08599..65be6998 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -96,7 +96,7 @@ TYPED_TEST(FooTest, HasPropertyA) { ... } // static std::string GetName(int) { // if (std::is_same()) return "char"; // if (std::is_same()) return "int"; -// if (std::is_same()) return "unsigned_int"; +// if (std::is_same()) return "unsignedInt"; // } // }; // TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames); diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index d6f7e0ba..df82517a 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -811,9 +811,9 @@ class TypedTestNames { template static std::string GetName(int i) { if (testing::internal::IsSame::value) - return std::string("char_") + ::testing::PrintToString(i); + return std::string("char") + ::testing::PrintToString(i); if (testing::internal::IsSame::value) - return std::string("int_") + ::testing::PrintToString(i); + return std::string("int") + ::testing::PrintToString(i); } }; @@ -852,10 +852,10 @@ class TypedTestPNames { template static std::string GetName(int i) { if (testing::internal::IsSame::value) { - return std::string("unsigned_char_") + ::testing::PrintToString(i); + return std::string("unsignedChar") + ::testing::PrintToString(i); } if (testing::internal::IsSame::value) { - return std::string("unsigned_int_") + ::testing::PrintToString(i); + return std::string("unsignedInt") + ::testing::PrintToString(i); } } }; diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc index e9eed639..b2457301 100644 --- a/googletest/test/gtest-typed-test_test.cc +++ b/googletest/test/gtest-typed-test_test.cc @@ -174,10 +174,10 @@ class TypedTestNames { template static std::string GetName(int i) { if (testing::internal::IsSame::value) { - return std::string("char_") + ::testing::PrintToString(i); + return std::string("char") + ::testing::PrintToString(i); } if (testing::internal::IsSame::value) { - return std::string("int_") + ::testing::PrintToString(i); + return std::string("int") + ::testing::PrintToString(i); } } }; @@ -189,13 +189,13 @@ TYPED_TEST(TypedTestWithNames, TestCaseName) { EXPECT_STREQ(::testing::UnitTest::GetInstance() ->current_test_info() ->test_case_name(), - "TypedTestWithNames/char_0"); + "TypedTestWithNames/char0"); } if (testing::internal::IsSame::value) { EXPECT_STREQ(::testing::UnitTest::GetInstance() ->current_test_info() ->test_case_name(), - "TypedTestWithNames/int_1"); + "TypedTestWithNames/int1"); } } @@ -311,13 +311,13 @@ TYPED_TEST_P(TypeParametrizedTestWithNames, TestCaseName) { EXPECT_STREQ(::testing::UnitTest::GetInstance() ->current_test_info() ->test_case_name(), - "CustomName/TypeParametrizedTestWithNames/p_char_0"); + "CustomName/TypeParametrizedTestWithNames/parChar0"); } if (testing::internal::IsSame::value) { EXPECT_STREQ(::testing::UnitTest::GetInstance() ->current_test_info() ->test_case_name(), - "CustomName/TypeParametrizedTestWithNames/p_int_1"); + "CustomName/TypeParametrizedTestWithNames/parInt1"); } } @@ -328,10 +328,10 @@ class TypeParametrizedTestNames { template static std::string GetName(int i) { if (testing::internal::IsSame::value) { - return std::string("p_char_") + ::testing::PrintToString(i); + return std::string("parChar") + ::testing::PrintToString(i); } if (testing::internal::IsSame::value) { - return std::string("p_int_") + ::testing::PrintToString(i); + return std::string("parInt") + ::testing::PrintToString(i); } } }; From 41b539941f8563e00dff5fc9d01510cb02d6467d Mon Sep 17 00:00:00 2001 From: misterg Date: Wed, 29 Aug 2018 11:39:59 -0400 Subject: [PATCH 3/7] Googletest export Silence MSVC warnings PiperOrigin-RevId: 210726964 --- googletest/test/googletest-output-test_.cc | 8 +++++++- googletest/test/gtest-typed-test_test.cc | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index df82517a..f6525ec9 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -39,6 +39,10 @@ #include +#if _MSC_VER +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */) +#endif // _MSC_VER + #if GTEST_IS_THREADSAFE using testing::ScopedFakeTestPartResultReporter; using testing::TestPartResultArray; @@ -1098,6 +1102,8 @@ int main(int argc, char **argv) { // are registered, and torn down in the reverse order. testing::AddGlobalTestEnvironment(new FooEnvironment); testing::AddGlobalTestEnvironment(new BarEnvironment); - +#if _MSC_VER +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127 +#endif // _MSC_VER return RunAllTests(); } diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc index b2457301..4e398697 100644 --- a/googletest/test/gtest-typed-test_test.cc +++ b/googletest/test/gtest-typed-test_test.cc @@ -35,6 +35,10 @@ #include "gtest/gtest.h" +#if _MSC_VER +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */) +#endif // _MSC_VER + using testing::Test; // Used for testing that SetUpTestCase()/TearDownTestCase(), fixture @@ -450,4 +454,8 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, TrimmedTest, TrimTypes); // must be defined). This dummy test keeps gtest_main linked in. TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {} +#if _MSC_VER +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127 +#endif // _MSC_VER + #endif // #if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P) From a5cc7aa3fe233111adbb05aacf03569a72fd6c3d Mon Sep 17 00:00:00 2001 From: misterg Date: Thu, 30 Aug 2018 16:26:26 -0400 Subject: [PATCH 4/7] Googletest export Fix broken OSS windows build. PiperOrigin-RevId: 210969049 --- googlemock/include/gmock/gmock-matchers.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 3975cd07..a7bcfc83 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -56,8 +56,10 @@ # include // NOLINT -- must be after gtest.h #endif -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ -/* class A needs to have dll-interface to be used by clients of class B */) +GTEST_DISABLE_MSC_WARNINGS_PUSH_( + 4251 5046 /* class A needs to have dll-interface to be used by clients of + class B */ + /* Symbol involving type with internal linkage not defined */) namespace testing { @@ -5270,7 +5272,7 @@ PolymorphicMatcher > VariantWith( } // namespace testing -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046 // Include any custom callback matchers added by the local installation. // We must include this header at the end to make sure it can use the From 0ecf38f3a24ba3e7111fd83247b5b5cc019a8d72 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Thu, 30 Aug 2018 21:42:07 -0400 Subject: [PATCH 5/7] Update googletest-output-test-golden-lin.txt manual update, golden lin --- .../googletest-output-test-golden-lin.txt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/googletest/test/googletest-output-test-golden-lin.txt b/googletest/test/googletest-output-test-golden-lin.txt index 7711cdc6..425a70e1 100644 --- a/googletest/test/googletest-output-test-golden-lin.txt +++ b/googletest/test/googletest-output-test-golden-lin.txt @@ -606,24 +606,24 @@ Expected failure Stack trace: (omitted) [ FAILED ] TypedTest/0.Failure, where TypeParam = int -[----------] 2 tests from TypedTestWithNames/char_0, where TypeParam = char -[ RUN ] TypedTestWithNames/char_0.Success -[ OK ] TypedTestWithNames/char_0.Success -[ RUN ] TypedTestWithNames/char_0.Failure +[----------] 2 tests from TypedTestWithNames/char0, where TypeParam = char +[ RUN ] TypedTestWithNames/char0.Success +[ OK ] TypedTestWithNames/char0.Success +[ RUN ] TypedTestWithNames/char0.Failure googletest-output-test_.cc:#: Failure Failed Stack trace: (omitted) -[ FAILED ] TypedTestWithNames/char_0.Failure, where TypeParam = char -[----------] 2 tests from TypedTestWithNames/int_1, where TypeParam = int -[ RUN ] TypedTestWithNames/int_1.Success -[ OK ] TypedTestWithNames/int_1.Success -[ RUN ] TypedTestWithNames/int_1.Failure +[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char +[----------] 2 tests from TypedTestWithNames/int1, where TypeParam = int +[ RUN ] TypedTestWithNames/int1.Success +[ OK ] TypedTestWithNames/int1.Success +[ RUN ] TypedTestWithNames/int1.Failure googletest-output-test_.cc:#: Failure Failed Stack trace: (omitted) -[ FAILED ] TypedTestWithNames/int_1.Failure, where TypeParam = int +[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int [----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char [ RUN ] Unsigned/TypedTestP/0.Success [ OK ] Unsigned/TypedTestP/0.Success From 76af254c474a0529e8d6bc1319d896f1dd1f19cd Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Thu, 30 Aug 2018 21:46:15 -0400 Subject: [PATCH 6/7] Update googletest-output-test-golden-lin.txt manual update golden lin --- .../googletest-output-test-golden-lin.txt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/googletest/test/googletest-output-test-golden-lin.txt b/googletest/test/googletest-output-test-golden-lin.txt index 425a70e1..8d96da64 100644 --- a/googletest/test/googletest-output-test-golden-lin.txt +++ b/googletest/test/googletest-output-test-golden-lin.txt @@ -652,10 +652,10 @@ Expected failure Stack trace: (omitted) [ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int -[----------] 2 tests from UnsignedCustomName/TypedTestP/unsigned_char_0, where TypeParam = unsigned char -[ RUN ] UnsignedCustomName/TypedTestP/unsigned_char_0.Success -[ OK ] UnsignedCustomName/TypedTestP/unsigned_char_0.Success -[ RUN ] UnsignedCustomName/TypedTestP/unsigned_char_0.Failure +[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedChar0, where TypeParam = unsigned char +[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Success +[ OK ] UnsignedCustomName/TypedTestP/unsignedChar0.Success +[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure googletest-output-test_.cc:#: Failure Expected equality of these values: 1U @@ -665,11 +665,11 @@ Expected equality of these values: Expected failure Stack trace: (omitted) -[ FAILED ] UnsignedCustomName/TypedTestP/unsigned_char_0.Failure, where TypeParam = unsigned char -[----------] 2 tests from UnsignedCustomName/TypedTestP/unsigned_int_1, where TypeParam = unsigned int -[ RUN ] UnsignedCustomName/TypedTestP/unsigned_int_1.Success -[ OK ] UnsignedCustomName/TypedTestP/unsigned_int_1.Success -[ RUN ] UnsignedCustomName/TypedTestP/unsigned_int_1.Failure +[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char +[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedInt1, where TypeParam = unsigned int +[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Success +[ OK ] UnsignedCustomName/TypedTestP/unsignedInt1.Success +[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure googletest-output-test_.cc:#: Failure Expected equality of these values: 1U @@ -679,7 +679,7 @@ Expected equality of these values: Expected failure Stack trace: (omitted) -[ FAILED ] UnsignedCustomName/TypedTestP/unsigned_int_1.Failure, where TypeParam = unsigned int +[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int [----------] 4 tests from ExpectFailureTest [ RUN ] ExpectFailureTest.ExpectFatalFailure (expecting 1 failure) From 6dd60ec437e839b9fa5af2cebf2c1c62de08cdff Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Fri, 31 Aug 2018 10:26:59 -0400 Subject: [PATCH 7/7] Update googletest-output-test-golden-lin.txt --- googletest/test/googletest-output-test-golden-lin.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/googletest/test/googletest-output-test-golden-lin.txt b/googletest/test/googletest-output-test-golden-lin.txt index 8d96da64..86da845b 100644 --- a/googletest/test/googletest-output-test-golden-lin.txt +++ b/googletest/test/googletest-output-test-golden-lin.txt @@ -944,12 +944,12 @@ Stack trace: (omitted) [ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns [ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows [ FAILED ] TypedTest/0.Failure, where TypeParam = int -[ FAILED ] TypedTestWithNames/char_0.Failure, where TypeParam = char -[ FAILED ] TypedTestWithNames/int_1.Failure, where TypeParam = int +[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char +[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int [ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char [ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int -[ FAILED ] UnsignedCustomName/TypedTestP/unsigned_char_0.Failure, where TypeParam = unsigned char -[ FAILED ] UnsignedCustomName/TypedTestP/unsigned_int_1.Failure, where TypeParam = unsigned int +[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char +[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int [ FAILED ] ExpectFailureTest.ExpectFatalFailure [ FAILED ] ExpectFailureTest.ExpectNonFatalFailure [ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads