diff options
| author | Stefan Boberg <[email protected]> | 2026-03-16 10:56:58 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-16 10:56:58 +0100 |
| commit | 7079dcf0d77f1ff4cfe66f87f21710068223a8d0 (patch) | |
| tree | 69f4b4ffea7da9b02e5cbf23b74c19558027007e /src/zencore/testing.cpp | |
| parent | Fix thread vector growth in dynamic thread pools (diff) | |
| parent | Enable cross compilation of Windows targets on Linux (#839) (diff) | |
| download | zen-7079dcf0d77f1ff4cfe66f87f21710068223a8d0.tar.xz zen-7079dcf0d77f1ff4cfe66f87f21710068223a8d0.zip | |
Merge branch 'main' into sb/threadpool
Diffstat (limited to 'src/zencore/testing.cpp')
| -rw-r--r-- | src/zencore/testing.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/zencore/testing.cpp b/src/zencore/testing.cpp index d7eb3b17d..f5bc723b1 100644 --- a/src/zencore/testing.cpp +++ b/src/zencore/testing.cpp @@ -24,6 +24,8 @@ # if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC # include <execinfo.h> # include <unistd.h> +# elif ZEN_PLATFORM_WINDOWS +# include <crtdbg.h> # endif namespace zen::testing { @@ -296,6 +298,17 @@ RunTestMain(int Argc, char* Argv[], const char* ExecutableName, void (*ForceLink } # endif +# if ZEN_PLATFORM_WINDOWS + // Suppress Windows error dialogs (crash/abort/assert) so tests terminate + // immediately instead of blocking on a modal dialog in CI or headless runs. + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); + _set_abort_behavior(0, _WRITE_ABORT_MSG); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); +# endif + zen::logging::InitializeLogging(); zen::MaximizeOpenFileCount(); InstallCrashSignalHandlers(); |