From 213650db8fd632d51358311e086f3de0cc6d90bd Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 18 Apr 2024 16:36:18 +0300 Subject: [PATCH] engine: exit with non-zero return code if engine tests are failed --- engine/common/host.c | 1 + engine/common/system.c | 2 +- engine/common/system.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/common/host.c b/engine/common/host.c index 6c928886..da08c408 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -941,6 +941,7 @@ static void Host_RunTests( int stage ) TEST_LIST_1_CLIENT; #endif Msg( "Done! %d passed, %d failed\n", tests_stats.passed, tests_stats.failed ); + error_on_exit = tests_stats.failed >= 0 ? EXIT_FAILURE : EXIT_SUCCESS; Sys_Quit(); } } diff --git a/engine/common/system.c b/engine/common/system.c index 47828760..da64deed 100644 --- a/engine/common/system.c +++ b/engine/common/system.c @@ -53,7 +53,7 @@ GNU General Public License for more details. #include "library.h" #include "whereami.h" -static int error_on_exit = 0; // arg for exit(); +int error_on_exit = 0; // arg for exit(); /* ================ diff --git a/engine/common/system.h b/engine/common/system.h index d06055f7..15f27b0f 100644 --- a/engine/common/system.h +++ b/engine/common/system.h @@ -41,7 +41,7 @@ NOTE: never change this structure because all dll descriptions in xash code writes into struct by offsets not names ======================================================================== */ - +extern int error_on_exit; void Sys_Sleep( int msec ); double Sys_DoubleTime( void ); char *Sys_GetClipboardData( void );