[compiler-rt] 8282724 - [NFC][sanitizer] Don't use ::testing::internal

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 15:26:17 PDT 2020


Author: Vitaly Buka
Date: 2020-09-18T15:26:05-07:00
New Revision: 82827244e9bbc2804afd9070158c567ac89f0540

URL: https://github.com/llvm/llvm-project/commit/82827244e9bbc2804afd9070158c567ac89f0540
DIFF: https://github.com/llvm/llvm-project/commit/82827244e9bbc2804afd9070158c567ac89f0540.diff

LOG: [NFC][sanitizer] Don't use ::testing::internal

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
index c05b665a6879..aa0fd60ec1e3 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
@@ -11,7 +11,6 @@
 //===----------------------------------------------------------------------===//
 #include "sanitizer_common/sanitizer_stackdepot.h"
 
-#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include "sanitizer_common/sanitizer_internal_defs.h"
 #include "sanitizer_common/sanitizer_libc.h"
@@ -80,13 +79,10 @@ TEST(SanitizerCommon, Maybe_StackDepotPrint) {
   StackTrace s2(array2, ARRAY_SIZE(array2));
   u32 i2 = StackDepotPut(s2);
   EXPECT_NE(i1, i2);
-  testing::internal::CaptureStderr();
-  StackDepotPrintAll();
-  EXPECT_THAT(
-      testing::internal::GetCapturedStderr(),
-      testing::MatchesRegex(
-          "Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
-          ".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*"));
+  EXPECT_EXIT(
+      (StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
+      "Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
+      ".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*");
 }
 
 TEST(SanitizerCommon, StackDepotReverseMap) {


        


More information about the llvm-commits mailing list