From 3289bec741188133dc06bfa0badd923efc1415b8 Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Thu, 12 Feb 2026 13:35:20 -0800 Subject: [PATCH] Re-enable death test matchers on Windows Remove the Windows-specific branch that disabled matcher verification. Update method_test.cpp to use cross-platform compatible regex syntax (.+ instead of [0-9]+ or \d+) since POSIX regex and GTest simple regex have different escape sequence support. This PR was authored with Claude. --- runtime/executor/test/method_test.cpp | 16 ++++++++-------- test/utils/DeathTest.h | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/runtime/executor/test/method_test.cpp b/runtime/executor/test/method_test.cpp index dc926184049..05a99a5e050 100644 --- a/runtime/executor/test/method_test.cpp +++ b/runtime/executor/test/method_test.cpp @@ -140,8 +140,8 @@ TEST_F(MethodTest, GetInputTests) { method->get_input(num_inputs - 1); // Out-of-range inputs should abort. - ET_EXPECT_DEATH(method->get_input(num_inputs), "[0-9]+ >= [0-9]+"); - ET_EXPECT_DEATH(method->get_input(num_inputs + 1), "[0-9]+ >= [0-9]+"); + ET_EXPECT_DEATH(method->get_input(num_inputs), ".+ >= .+"); + ET_EXPECT_DEATH(method->get_input(num_inputs + 1), ".+ >= .+"); } TEST_F(MethodTest, MutableInputTests) { @@ -157,8 +157,8 @@ TEST_F(MethodTest, MutableInputTests) { method->mutable_input(num_inputs - 1); // Out-of-range inputs should abort. - ET_EXPECT_DEATH(method->mutable_input(num_inputs), "[0-9]+ >= [0-9]+"); - ET_EXPECT_DEATH(method->mutable_input(num_inputs + 1), "[0-9]+ >= [0-9]+"); + ET_EXPECT_DEATH(method->mutable_input(num_inputs), ".+ >= .+"); + ET_EXPECT_DEATH(method->mutable_input(num_inputs + 1), ".+ >= .+"); } TEST_F(MethodTest, GetOutputTests) { @@ -174,8 +174,8 @@ TEST_F(MethodTest, GetOutputTests) { method->get_output(num_outputs - 1); // Out-of-range outputs should abort. - ET_EXPECT_DEATH(method->get_output(num_outputs), "[0-9]+ >= [0-9]+"); - ET_EXPECT_DEATH(method->get_output(num_outputs + 1), "[0-9]+ >= [0-9]+"); + ET_EXPECT_DEATH(method->get_output(num_outputs), ".+ >= .+"); + ET_EXPECT_DEATH(method->get_output(num_outputs + 1), ".+ >= .+"); } TEST_F(MethodTest, MutableOutputTests) { @@ -191,8 +191,8 @@ TEST_F(MethodTest, MutableOutputTests) { method->mutable_output(num_outputs - 1); // Out-of-range outputs should abort. - ET_EXPECT_DEATH(method->mutable_output(num_outputs), "[0-9]+ >= [0-9]+"); - ET_EXPECT_DEATH(method->mutable_output(num_outputs + 1), "[0-9]+ >= [0-9]+"); + ET_EXPECT_DEATH(method->mutable_output(num_outputs), ".+ >= .+"); + ET_EXPECT_DEATH(method->mutable_output(num_outputs + 1), ".+ >= .+"); } TEST_F(MethodTest, SetPrimInputTest) { diff --git a/test/utils/DeathTest.h b/test/utils/DeathTest.h index 90203324756..50807006657 100644 --- a/test/utils/DeathTest.h +++ b/test/utils/DeathTest.h @@ -33,12 +33,11 @@ #define ET_EXPECT_DEATH(_statement, _matcher) ((void)0) #define ET_EXPECT_DEATH_NO_PAL_INIT(_statement, _matcher) ((void)0) -#elif defined(_WIN32) || !ET_LOG_ENABLED +#elif !ET_LOG_ENABLED /** - * On Windows, death test stderr matching is unreliable. * When logging is disabled, ET_CHECK_MSG doesn't output error messages. - * In both cases, we ignore the matcher and only verify that the statement + * In this case, we ignore the matcher and only verify that the statement * causes the process to terminate. */ #define ET_EXPECT_DEATH(_statement, _matcher) \