From e3c25c16994371a9bbfa1e7cd8e32ffa27115413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20VERDO=C3=8FA?= Date: Sun, 29 Mar 2020 14:58:47 +0200 Subject: [PATCH 1/6] Fix --gtest_print_time coloring --- googletest/src/gtest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 4c8b42f9..5f7257d8 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6167,7 +6167,7 @@ static const char kColorEncodedHelpMessage[] = "Test Output:\n" " @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n" " Enable/disable colored output. The default is @Gauto@D.\n" -" -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n" +" @G--" GTEST_FLAG_PREFIX_ "print_time=0@D\n" " Don't print the elapsed time of each test.\n" " @G--" GTEST_FLAG_PREFIX_ "output=@Y(@Gjson@Y|@Gxml@Y)[@G:@YDIRECTORY_PATH@G" GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n" From 09f587512a761eed4b33069456020680b320e7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 May 2020 10:13:33 +0300 Subject: [PATCH 2/6] Revert "Googletest export" This reverts commit a9f6c1ed1401dd9b002d4c43fb9f946d2c7466d0. That commit cannot fix the issue it sets out to fix. The original issue, #2822, was that building with a toolset targeting XP compatibility is missing the debugapi.h header - as debugapi.h didn't exist in older Windows SDKs. Commit a9f6c1ed1401dd9b002d4c43fb9f946d2c7466d0 misinterpreted the Microsoft documentation about IsDebuggerPresent. The information about which header to use, "debugapi.h (include Windows.h)" means that the function declaration currently lives in debugapi.h, but for compatibility, just include the Windows.h umbrella header. In older Windows SDKs (e.g. the v6.0a SDK), IsDebuggerPresent is declared in winbase.h, and debugapi.h doesn't exist at all in those versions. Including Windows.h with a different capitalization than the existing include won't help finding headers that don't exist. Including Windows.h with a capital W breaks cross compilation with mingw toolchains, where the header always has been spelled with a lower case W. When building on native windows, the file system is case insensitive and the capitalization doesn't matter. This fixes issue #2840. --- googletest/src/gtest.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index c6722800..72827195 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -81,7 +81,6 @@ #elif GTEST_OS_WINDOWS // We are on Windows proper. -# include // NOLINT # include // NOLINT # undef min From d86e9e23ceab0b24f4698f063672efd37dec85b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 May 2020 10:19:57 +0300 Subject: [PATCH 3/6] Remove an explicit include of debugapi.h The documentation for IsDebuggerPresent says that one just should include windows.h, as that one is an umbrella header that includes the header that declares IsDebuggerPresent. In older Windows SDKs, debugapi.h didn't exist and IsDebuggerPresent was declared in winbase.h (also included by windows.h). This should fix issue #2822 properly. --- googletest/src/gtest.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 72827195..5e94c215 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -86,7 +86,6 @@ #ifdef _MSC_VER # include // NOLINT -# include // NOLINT #endif # include // NOLINT From fe5300ebf116ef2ba955dca7bf6bf14619b6a54c Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 11 May 2020 09:47:40 -0400 Subject: [PATCH 4/6] Googletest export Addresses https://github.com/google/googletest/pull/2784 PiperOrigin-RevId: 310902202 --- googlemock/docs/community_created_documentation.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 googlemock/docs/community_created_documentation.md diff --git a/googlemock/docs/community_created_documentation.md b/googlemock/docs/community_created_documentation.md new file mode 100644 index 00000000..dfd87f7a --- /dev/null +++ b/googlemock/docs/community_created_documentation.md @@ -0,0 +1,9 @@ +# Community-Created Documentation + +go/gunit-community-created-docs + +The following is a list, in no particular order, of links to documentation +created by the Googletest community. + +* [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), + by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) From 8a32680cee020e62b87d4ed517d0201580101713 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 13 May 2020 10:52:56 -0400 Subject: [PATCH 5/6] Googletest export Fixed #2823 - Make it so that a semicolon appearing after an invocation of GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ does not trigger a redundant semicolon warning. This works by introducing an else block with a statement that intentionally does not end with a semicolon, forcing users to place the semicolon after the expansion. The approach here is preferred as opposed to removing semicolons that appear after each invocation because complete statements that do not have a visible semicolon or braces confuse users and code formatters, since the macro invocation looks superficially like an expression. PiperOrigin-RevId: 311327491 --- googletest/include/gtest/internal/gtest-internal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index fabc8042..028f21eb 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1283,8 +1283,13 @@ constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; } // Suppress MSVC warning 4072 (unreachable code) for the code following // statement if it returns or throws (or doesn't return or throw in some // situations). +// NOTE: The "else" is important to keep this expansion to prevent a top-level +// "else" from attaching to our "if". #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ - if (::testing::internal::AlwaysTrue()) { statement; } + if (::testing::internal::AlwaysTrue()) { \ + statement; \ + } else /* NOLINT */ \ + static_assert(true, "") // User must have a semicolon after expansion. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ From 011959aafddcd30611003de96cfd8d7a7685c700 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 13 May 2020 15:09:32 -0400 Subject: [PATCH 6/6] Googletest export Remove broken URL. PiperOrigin-RevId: 311377660 --- googletest/docs/advanced.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/googletest/docs/advanced.md b/googletest/docs/advanced.md index a5dd6226..7ca40fef 100644 --- a/googletest/docs/advanced.md +++ b/googletest/docs/advanced.md @@ -2288,8 +2288,7 @@ environment variable to `0`. googletest can emit a detailed XML report to a file in addition to its normal textual output. The report contains the duration of each test, and thus can help -you identify slow tests. The report is also used by the http://unittest -dashboard to show per-test-method error messages. +you identify slow tests. To generate the XML report, set the `GTEST_OUTPUT` environment variable or the `--gtest_output` flag to the string `"xml:path_to_output_file"`, which will