aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_embed/catch.cpp
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-07-23 08:58:19 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-07-23 08:58:19 +0200
commit444e535f000fd7b53dadf6726d5cd29ac34cc75f (patch)
tree1ac675d8f0381de320849294fa70c946f631e7f6 /3rdparty/pybind11/tests/test_embed/catch.cpp
parente6991ad5dc79f6118838f091cc05f10d3377eb4a (diff)
downloadnextpnr-444e535f000fd7b53dadf6726d5cd29ac34cc75f.tar.gz
nextpnr-444e535f000fd7b53dadf6726d5cd29ac34cc75f.tar.bz2
nextpnr-444e535f000fd7b53dadf6726d5cd29ac34cc75f.zip
Add pybind11 2.5 source
Diffstat (limited to '3rdparty/pybind11/tests/test_embed/catch.cpp')
-rw-r--r--3rdparty/pybind11/tests/test_embed/catch.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/3rdparty/pybind11/tests/test_embed/catch.cpp b/3rdparty/pybind11/tests/test_embed/catch.cpp
new file mode 100644
index 00000000..dd137385
--- /dev/null
+++ b/3rdparty/pybind11/tests/test_embed/catch.cpp
@@ -0,0 +1,22 @@
+// The Catch implementation is compiled here. This is a standalone
+// translation unit to avoid recompiling it for every test change.
+
+#include <pybind11/embed.h>
+
+#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
+
+#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;
+}