catch.cpp 414 Bytes
Newer Older
1
// The Catch implementation is compiled here. This is a standalone
2
3
// translation unit to avoid recompiling it for every test change.

4
5
6
#include <pybind11/embed.h>

#define CATCH_CONFIG_RUNNER
7
#include <catch.hpp>
8
9
10
11
12
13
14
15
16

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;
}