RFR: 8348029: Make gtest death tests work with real crash signals
Sonia Zaldana Calles
szaldana at openjdk.org
Tue Jan 21 13:06:43 UTC 2025
On Sat, 18 Jan 2025 17:05:19 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Small change adds a new macro to the gtest TEST macro zoo: `TEST_VM_CRASH_SIGNAL`. This one is a companion to `TEST_VM_FATAL_ERROR_MSG` and `TEST_VM_ASSERT_MSG` and allows to write gtest that test expected crashes to happen. I will need that for a regression test for https://bugs.openjdk.org/browse/JDK-8330174 , among other things.
>
> You use it like this:
>
>
> TEST_VM_CRASH_SIGNAL(Testtest, test, "SIGSEGV") {
> ... do something that you expect should result in a specific crash ...
> }
>
> Note that the string provided is platform dependent (signal names on Posix, SEH names on Windows).
I am not a Reviewer but this looks good to me. Also very useful! Thanks @tstuefe.
-------------
Marked as reviewed by szaldana (Committer).
PR Review: https://git.openjdk.org/jdk/pull/23191#pullrequestreview-2564570995
More information about the hotspot-dev
mailing list