2017-03-29 22:20:42 +00:00
|
|
|
// The Catch implementation is compiled here. This is a standalone
|
2017-03-23 16:27:32 +00:00
|
|
|
// translation unit to avoid recompiling it for every test change.
|
|
|
|
|
2017-03-29 22:20:42 +00:00
|
|
|
#include <pybind11/embed.h>
|
|
|
|
|
2017-12-15 14:15:25 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
// 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).
|
|
|
|
# pragma warning(disable: 4996)
|
|
|
|
#endif
|
|
|
|
|
2017-03-29 22:20:42 +00:00
|
|
|
#define CATCH_CONFIG_RUNNER
|
2017-03-23 16:27:32 +00:00
|
|
|
#include <catch.hpp>
|
2017-03-29 22:20:42 +00:00
|
|
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
2018-07-19 18:03:26 +00:00
|
|
|
int main(int argc, char *argv[]) {
|
2017-03-29 22:20:42 +00:00
|
|
|
py::scoped_interpreter guard{};
|
|
|
|
auto result = Catch::Session().run(argc, argv);
|
|
|
|
|
|
|
|
return result < 0xff ? result : 0xff;
|
|
|
|
}
|