catch.cpp revision 12391
112391Sjason@lowepower.com// The Catch implementation is compiled here. This is a standalone 212391Sjason@lowepower.com// translation unit to avoid recompiling it for every test change. 312391Sjason@lowepower.com 412391Sjason@lowepower.com#include <pybind11/embed.h> 512391Sjason@lowepower.com 612391Sjason@lowepower.com#define CATCH_CONFIG_RUNNER 712391Sjason@lowepower.com#include <catch.hpp> 812391Sjason@lowepower.com 912391Sjason@lowepower.comnamespace py = pybind11; 1012391Sjason@lowepower.com 1112391Sjason@lowepower.comint main(int argc, const char *argv[]) { 1212391Sjason@lowepower.com py::scoped_interpreter guard{}; 1312391Sjason@lowepower.com auto result = Catch::Session().run(argc, argv); 1412391Sjason@lowepower.com 1512391Sjason@lowepower.com return result < 0xff ? result : 0xff; 1612391Sjason@lowepower.com} 17