[PATCH] D95256: [RGT] Don't use EXPECT* macros in a test subprcess that exits by signalling.
Paul Robinson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 22 15:05:16 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ea7ecbb72aa: [RGT] Don't use EXPECT* macros in a subprocess that exits by signalling (authored by probinson).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95256/new/
https://reviews.llvm.org/D95256
Files:
llvm/unittests/Support/CrashRecoveryTest.cpp
Index: llvm/unittests/Support/CrashRecoveryTest.cpp
===================================================================
--- llvm/unittests/Support/CrashRecoveryTest.cpp
+++ llvm/unittests/Support/CrashRecoveryTest.cpp
@@ -157,8 +157,12 @@
if (getenv("LLVM_CRC_UNIXCRCRETURNCODE")) {
llvm::CrashRecoveryContext::Enable();
CrashRecoveryContext CRC;
- EXPECT_FALSE(CRC.RunSafely(abort));
- EXPECT_EQ(CRC.RetCode, 128 + SIGABRT);
+ // This path runs in a subprocess that exits by signalling, so don't use
+ // the googletest macros to verify things as they won't report properly.
+ if (CRC.RunSafely(abort))
+ llvm_unreachable("RunSafely returned true!");
+ if (CRC.RetCode != 128 + SIGABRT)
+ llvm_unreachable("Unexpected RetCode!");
// re-throw signal
llvm::sys::unregisterHandlers();
raise(CRC.RetCode - 128);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95256.318660.patch
Type: text/x-patch
Size: 865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210122/eeb52b33/attachment.bin>
More information about the llvm-commits
mailing list