diff options
author | Dino Radakovic <dinor@google.com> | 2022-06-16 13:17:21 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-06-16 13:18:04 -0700 |
commit | 44050f0d60e8196773f9af693932b668d1877c1b (patch) | |
tree | 709fc747fda4706d751d367a5128ab2cc06c24cf /absl | |
parent | 6b6d40f999f09b1bbc0150e8f57a2c39a93d25e5 (diff) |
Revert GoogleTest version used by Abseil to commit 28e1da21d8d677bc98f12ccc7fc159ff19e8e817
Using GoogleTest at 0320f517fd920866d918e564105d68fd4362040a breaks Windows DLLs.
PiperOrigin-RevId: 455452411
Change-Id: Iff89a01351c01487786a22701efedf25860fadf9
Diffstat (limited to 'absl')
-rw-r--r-- | absl/flags/CMakeLists.txt | 2 | ||||
-rw-r--r-- | absl/flags/internal/usage_test.cc | 18 |
2 files changed, 6 insertions, 14 deletions
diff --git a/absl/flags/CMakeLists.txt b/absl/flags/CMakeLists.txt index 3e9d5adf..79e51a11 100644 --- a/absl/flags/CMakeLists.txt +++ b/absl/flags/CMakeLists.txt @@ -466,5 +466,5 @@ absl_cc_test( absl::flags_reflection absl::flags_usage absl::strings - GTest::gmock + GTest::gtest ) diff --git a/absl/flags/internal/usage_test.cc b/absl/flags/internal/usage_test.cc index 209a7be9..6a65a1a3 100644 --- a/absl/flags/internal/usage_test.cc +++ b/absl/flags/internal/usage_test.cc @@ -20,7 +20,6 @@ #include <sstream> #include <string> -#include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/flags/flag.h" #include "absl/flags/internal/parse.h" @@ -106,19 +105,14 @@ class UsageReportingTest : public testing::Test { using UsageReportingDeathTest = UsageReportingTest; TEST_F(UsageReportingDeathTest, TestSetProgramUsageMessage) { -#if !defined(GTEST_HAS_ABSL) || !GTEST_HAS_ABSL - // Check for kTestUsageMessage set in main() below. EXPECT_EQ(absl::ProgramUsageMessage(), kTestUsageMessage); -#else - // Check for part of the usage message set by GoogleTest. - EXPECT_THAT(absl::ProgramUsageMessage(), - ::testing::HasSubstr( - "This program contains tests written using Google Test")); -#endif +#ifndef _WIN32 + // TODO(rogeeff): figure out why this does not work on Windows. EXPECT_DEATH_IF_SUPPORTED( absl::SetProgramUsageMessage("custom usage message"), - ::testing::HasSubstr("SetProgramUsageMessage() called twice")); + ".*SetProgramUsageMessage\\(\\) called twice.*"); +#endif } // -------------------------------------------------------------------- @@ -495,10 +489,8 @@ path. int main(int argc, char* argv[]) { (void)absl::GetFlag(FLAGS_undefok); // Force linking of parse.cc flags::SetProgramInvocationName("usage_test"); -#if !defined(GTEST_HAS_ABSL) || !GTEST_HAS_ABSL - // GoogleTest calls absl::SetProgramUsageMessage() already. absl::SetProgramUsageMessage(kTestUsageMessage); -#endif ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } |