blob: dd137385cb32250b8640169934fb96aa5e80f069 [file] [log] [blame]
Dean Moldovan22c413b2017-03-30 00:20:42 +02001// The Catch implementation is compiled here. This is a standalone
Dean Moldovan9693a5c2017-03-23 17:27:32 +01002// translation unit to avoid recompiling it for every test change.
3
Dean Moldovan22c413b2017-03-30 00:20:42 +02004#include <pybind11/embed.h>
5
Jason Rhinelander3be401f2017-12-15 10:15:25 -04006#ifdef _MSC_VER
7// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to catch
8// 2.0.1; this should be fixed in the next catch release after 2.0.1).
9# pragma warning(disable: 4996)
10#endif
11
Dean Moldovan22c413b2017-03-30 00:20:42 +020012#define CATCH_CONFIG_RUNNER
Dean Moldovan9693a5c2017-03-23 17:27:32 +010013#include <catch.hpp>
Dean Moldovan22c413b2017-03-30 00:20:42 +020014
15namespace py = pybind11;
16
Jason Rhinelanderf7bc18f2018-07-19 15:03:26 -030017int main(int argc, char *argv[]) {
Dean Moldovan22c413b2017-03-30 00:20:42 +020018 py::scoped_interpreter guard{};
19 auto result = Catch::Session().run(argc, argv);
20
21 return result < 0xff ? result : 0xff;
22}