Dean Moldovan | 22c413b | 2017-03-30 00:20:42 +0200 | [diff] [blame^] | 1 | // The Catch implementation is compiled here. This is a standalone |
Dean Moldovan | 9693a5c | 2017-03-23 17:27:32 +0100 | [diff] [blame] | 2 | // translation unit to avoid recompiling it for every test change. |
| 3 | |
Dean Moldovan | 22c413b | 2017-03-30 00:20:42 +0200 | [diff] [blame^] | 4 | #include <pybind11/embed.h> |
| 5 | |
| 6 | #define CATCH_CONFIG_RUNNER |
Dean Moldovan | 9693a5c | 2017-03-23 17:27:32 +0100 | [diff] [blame] | 7 | #include <catch.hpp> |
Dean Moldovan | 22c413b | 2017-03-30 00:20:42 +0200 | [diff] [blame^] | 8 | |
| 9 | namespace py = pybind11; |
| 10 | |
| 11 | int main(int argc, const char *argv[]) { |
| 12 | py::scoped_interpreter guard{}; |
| 13 | auto result = Catch::Session().run(argc, argv); |
| 14 | |
| 15 | return result < 0xff ? result : 0xff; |
| 16 | } |