catch.cpp 637 B

1234567891011121314151617181920212223
  1. // The Catch implementation is compiled here. This is a standalone
  2. // translation unit to avoid recompiling it for every test change.
  3. #include <pybind11/embed.h>
  4. #ifdef _MSC_VER
  5. // Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to catch
  6. // 2.0.1; this should be fixed in the next catch release after 2.0.1).
  7. # pragma warning(disable: 4996)
  8. #endif
  9. #define CATCH_CONFIG_RUNNER
  10. #include <catch.hpp>
  11. namespace py = pybind11;
  12. int main(int argc, char *argv[]) {
  13. py::scoped_interpreter guard{};
  14. auto result = Catch::Session().run(argc, argv);
  15. return result < 0xff ? result : 0xff;
  16. }