Skip to content

Commit

Permalink
I really didn't want this much
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarWatcher committed Jun 18, 2020
1 parent 92711ec commit 45366b7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testSources/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
#define THIS_IS_WINDOZE
#include <rtcapi.h>
#include <windows.h>

int exceptionHandler(LPEXCEPTION_POINTERS p) {
printf("Fail\n");
exit(1);
}
int runtimeCheckHandler(
int errorType, const char* filename, int linenumber, const char* moduleName, const char* format, ...) {
printf("Error: type %d at %s line %d in %s", errorType, filename, linenumber, moduleName);
exit(1);
}
#endif
// This is the primary testing file. Specifically, this defines the entry point.
// It's also empty because Catch2 is super nice. All tests are defined in .cpp
Expand All @@ -14,6 +24,9 @@ int main(int argc, const char* argv[]) {
#ifdef THIS_IS_WINDOZE
DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX);
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)&exceptionHandler);
_RTC_SetErrorFunc(&runtimeCheckHandler);

#endif

const static auto directory = "./tests/raw/data";
Expand Down

0 comments on commit 45366b7

Please sign in to comment.