[PATCH] D94362: [scudo][standalone] Enable death tests on Fuchsia

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 11:31:29 PST 2021


cryptoad added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h:21
+#ifdef ASSERT_DEATH
+#define EXPECT_DEATH(X, Y) ASSERT_DEATH(([&] { X; }), Y)
+#else
----------------
mcgrathr wrote:
> The second argument to zxtest's ASSERT_DEATH is not comparable to the gtest EXPECT_DEATH argument.
> In zxtest, it's just a message and printf args like in other ASSERT_* macros.
> In gtest, it's a matcher for the error output of the crashing process.
> In zxtest, the the test is run in a separate thread and not a separate process, so you need to make sure your death tests' assumptions don't include that fouling the process-wide state is OK.  There is no facility for matching any particular kind of crash, it just checks that the thread got a fatal exception of some kind.
> 
Thank you for pointing this out, I didn't realize it.
Currently most of the matchers are "", with a few being actual regexps, which could lead to confusion when they are dumped out. I could replace Y with "" since I don't think we need additional output information for those.
Regarding the state, for now everything is passing, but I'll go and check them one by one to make sure they don't mess with a process-wide state.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94362/new/

https://reviews.llvm.org/D94362



More information about the llvm-commits mailing list