Blame external/pybind11/tests/test_embed/catch.cpp
|
Packit |
534379 |
// The Catch implementation is compiled here. This is a standalone
|
|
Packit |
534379 |
// translation unit to avoid recompiling it for every test change.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
#include <pybind11/embed.h>
|
|
Packit |
534379 |
|
|
Packit |
534379 |
#ifdef _MSC_VER
|
|
Packit |
534379 |
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to catch
|
|
Packit |
534379 |
// 2.0.1; this should be fixed in the next catch release after 2.0.1).
|
|
Packit |
534379 |
# pragma warning(disable: 4996)
|
|
Packit |
534379 |
#endif
|
|
Packit |
534379 |
|
|
Packit |
534379 |
#define CATCH_CONFIG_RUNNER
|
|
Packit |
534379 |
#include <catch.hpp>
|
|
Packit |
534379 |
|
|
Packit |
534379 |
namespace py = pybind11;
|
|
Packit |
534379 |
|
|
Packit |
534379 |
int main(int argc, char *argv[]) {
|
|
Packit |
534379 |
py::scoped_interpreter guard{};
|
|
Packit |
534379 |
auto result = Catch::Session().run(argc, argv);
|
|
Packit |
534379 |
|
|
Packit |
534379 |
return result < 0xff ? result : 0xff;
|
|
Packit |
534379 |
}
|