2021-03-08 14:54:22 +00:00
|
|
|
// The Catch implementation is compiled here. This is a standalone
|
|
|
|
// translation unit to avoid recompiling it for every test change.
|
|
|
|
|
|
|
|
#include <pybind11/embed.h>
|
|
|
|
|
2023-04-18 16:11:43 +00:00
|
|
|
#ifdef _MSC_VER
|
2022-06-20 22:59:56 +00:00
|
|
|
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
|
|
|
|
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
|
2023-04-18 16:11:43 +00:00
|
|
|
# pragma warning(disable : 4996)
|
|
|
|
#endif
|
2022-06-20 22:59:56 +00:00
|
|
|
|
|
|
|
// Catch uses _ internally, which breaks gettext style defines
|
|
|
|
#ifdef _
|
|
|
|
# undef _
|
2021-03-08 14:54:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CATCH_CONFIG_RUNNER
|
|
|
|
#include <catch.hpp>
|
|
|
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
py::scoped_interpreter guard{};
|
|
|
|
auto result = Catch::Session().run(argc, argv);
|
|
|
|
|
|
|
|
return result < 0xff ? result : 0xff;
|
|
|
|
}
|