mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
infra update
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
98500ee653
commit
d14e45c8e6
@ -10,9 +10,11 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include <windows.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
|
||||
std::string lastTest("");
|
||||
static int newStdOut = -1;
|
||||
|
||||
LONG WINAPI UltExceptionFilter(
|
||||
_In_ struct _EXCEPTION_POINTERS *exceptionInfo) {
|
||||
@ -23,6 +25,9 @@ LONG WINAPI UltExceptionFilter(
|
||||
|
||||
void (*oldSigAbrt)(int) = nullptr;
|
||||
void handleSIGABRT(int sigNo) {
|
||||
if (newStdOut != -1) {
|
||||
_dup2(newStdOut, 1);
|
||||
}
|
||||
std::cout << "SIGABRT on: " << lastTest << std::endl;
|
||||
signal(SIGABRT, oldSigAbrt);
|
||||
raise(sigNo);
|
||||
@ -31,6 +36,10 @@ void handleSIGABRT(int sigNo) {
|
||||
int setAbrt(bool enableAbrt) {
|
||||
std::cout << "enable SIGABRT handler: " << enableAbrt << std::endl;
|
||||
|
||||
if (newStdOut == -1) {
|
||||
newStdOut = _dup(1);
|
||||
}
|
||||
|
||||
SetUnhandledExceptionFilter(&UltExceptionFilter);
|
||||
if (enableAbrt) {
|
||||
oldSigAbrt = signal(SIGABRT, handleSIGABRT);
|
||||
|
Reference in New Issue
Block a user