* This PR allows for extra exceptions in the debug mode (GCC/LLVM) on Linux based OSes - it does not work on the other operating systems. Relevant documentation: https://linux.die.net/man/3/feenableexcept
23 lines
552 B
C++
23 lines
552 B
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Keep this file empty, and implement unit tests in separate compilation units!
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#define CATCH_CONFIG_MAIN
|
|
#include <catch2/catch.hpp>
|
|
|
|
#ifndef NDEBUG
|
|
#ifdef __linux__
|
|
#include <fenv.h>
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef NDEBUG
|
|
#ifdef __linux__
|
|
void beforeMain (void) __attribute__((constructor));
|
|
void beforeMain (void)
|
|
{
|
|
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
|
|
}
|
|
#endif
|
|
#endif
|