infra update

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-08-18 15:56:59 +00:00
committed by Compute-Runtime-Automation
parent 98500ee653
commit d14e45c8e6
11 changed files with 86 additions and 77 deletions

View File

@ -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);