diff options
Diffstat (limited to 'ext/pybind11/tests/test_embed/catch.cpp')
-rw-r--r-- | ext/pybind11/tests/test_embed/catch.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/pybind11/tests/test_embed/catch.cpp b/ext/pybind11/tests/test_embed/catch.cpp new file mode 100644 index 000000000..cface485d --- /dev/null +++ b/ext/pybind11/tests/test_embed/catch.cpp @@ -0,0 +1,16 @@ +// The Catch implementation is compiled here. This is a standalone +// translation unit to avoid recompiling it for every test change. + +#include <pybind11/embed.h> + +#define CATCH_CONFIG_RUNNER +#include <catch.hpp> + +namespace py = pybind11; + +int main(int argc, const char *argv[]) { + py::scoped_interpreter guard{}; + auto result = Catch::Session().run(argc, argv); + + return result < 0xff ? result : 0xff; +} |