Browse Source

last test

marauder2k7 2 years ago
parent
commit
192250cc7c

+ 1 - 1
.github/workflows/cmake.yml

@@ -19,7 +19,7 @@ jobs:
     runs-on: ${{matrix.os}}
     strategy:
       matrix:
-        os: [ ubuntu-latest, macos-latest ]
+        os: [ ubuntu-latest, macos-latest, windows-latest ]
 
     steps:
       - uses: actions/checkout@v3

+ 5 - 1
Engine/source/CMakeLists.txt

@@ -13,6 +13,10 @@ forwardDef(TORQUE_BASIC_LIGHTING)
 set(TORQUE_SDL ON) # we need sdl to do our platform interop
 forwardDef(TORQUE_SDL)
 
+if(TORQUE_TESTING)
+forwardDef(TORQUE_TESTS_ENABLED)
+endif()
+
 # On Windows we disable CRT Security warnings - this comes from recommendations to use non-portable functions.
 if (WIN32)
 	set(TORQUE_COMPILE_DEFINITIONS ${TORQUE_COMPILE_DEFINITIONS} _CRT_SECURE_NO_WARNINGS WIN32)
@@ -212,7 +216,7 @@ endif (UNIX AND NOT APPLE)
 
 if(TORQUE_TESTING)
   torqueAddSourceDirectories("testing")
-  set(TORQUE_COMPILE_DEFINITIONS ${TORQUE_COMPILE_DEFINITIONS} TORQUE_SHARED SDL_MAIN_HANDLED TORQUE_TESTS_ENABLED)
+  set(TORQUE_COMPILE_DEFINITIONS ${TORQUE_COMPILE_DEFINITIONS} TORQUE_SHARED SDL_MAIN_HANDLED)
 endif(TORQUE_TESTING)
 
 # Add the collected files to our engine group

+ 15 - 12
Engine/source/platformPOSIX/POSIXProcessControl.cpp

@@ -33,7 +33,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <signal.h>
-#include <execinfo.h>
 #include "console/engineAPI.h"
 #include "core/util/journal/process.h"
 #ifndef TORQUE_DEDICATED
@@ -60,17 +59,21 @@ static void CheckExitCode(S64 exitCode)
 //-----------------------------------------------------------------------------
 static void SignalHandler(int sigtype)
 {
-   void* array[10];
-   size_t size;
-   
-   signal(sigtype, SIG_DFL);
-
-   size = backtrace(array, 10);
-
-   dPrintf("Error: signal: % d\n", sigtype);
-   backtrace_symbols_fd(array, size, STDERR_FILENO);
-   // exit to be safe
-   ImmediateShutdown(1);
+   if (sigtype == SIGSEGV || sigtype == SIGTRAP)
+   {
+      signal(SIGSEGV, SIG_DFL);
+      signal(SIGTRAP, SIG_DFL);
+      // restore the signal handling to default so that we don't get into
+      // a crash loop with ImmediateShutdown
+      ImmediateShutdown(-sigtype, sigtype);
+   }
+   else
+   {
+      signal(sigtype, SIG_DFL);
+      dPrintf("Unknown signal caught by SignalHandler: %d\n", sigtype);
+      // exit to be safe
+      ImmediateShutdown(1);
+   }
 }
 
 //-----------------------------------------------------------------------------