main.cpp 552 B

1234567891011121314151617181920212223
  1. ////////////////////////////////////////////////////////////////////////////////
  2. // Keep this file empty, and implement unit tests in separate compilation units!
  3. ////////////////////////////////////////////////////////////////////////////////
  4. #define CATCH_CONFIG_MAIN
  5. #include <catch2/catch.hpp>
  6. #ifndef NDEBUG
  7. #ifdef __linux__
  8. #include <fenv.h>
  9. #endif
  10. #endif
  11. #ifndef NDEBUG
  12. #ifdef __linux__
  13. void beforeMain (void) __attribute__((constructor));
  14. void beforeMain (void)
  15. {
  16. feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
  17. }
  18. #endif
  19. #endif