From 750aecb6de647d9ac40e3962b59539fc700fe460 Mon Sep 17 00:00:00 2001 From: mo Date: Tue, 25 Aug 2026 12:57:58 +1200 Subject: [PATCH] win test runner: ignore informational exceptions and accept BREAK and CLOSE as synonyms for CTRL_C --- core/testing/signal_handler_windows.odin | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/testing/signal_handler_windows.odin b/core/testing/signal_handler_windows.odin index f9d0f85a7..3f07c348e 100644 --- a/core/testing/signal_handler_windows.odin +++ b/core/testing/signal_handler_windows.odin @@ -48,7 +48,7 @@ when ODIN_ARCH == .i386 { @(private="file") stop_runner_callback :: proc "system" (ctrl_type: win32.DWORD) -> win32.BOOL { - if ctrl_type == win32.CTRL_C_EVENT { + if ctrl_type == win32.CTRL_C_EVENT || ctrl_type == win32.CTRL_BREAK_EVENT || ctrl_type == win32.CTRL_CLOSE_EVENT { prev := intrinsics.atomic_add(&stop_runner_flag, 1) // If the flag was already set (if this is the second signal sent for example), @@ -77,6 +77,12 @@ stop_test_callback :: proc "system" (info: ^win32.EXCEPTION_POINTERS) -> win32.L context = runtime.default_context() code := info.ExceptionRecord.ExceptionCode + if code < 0x8000_0000 { + // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781 + // Ignore informational status codes + return win32.EXCEPTION_CONTINUE_SEARCH + } + if local_test_index == -1 { // We're the test runner, and we ourselves have caught a signal from @@ -210,4 +216,3 @@ _should_stop_test :: proc() -> (test_index: int, reason: Stop_Reason, ok: bool) return } -