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
614299Sbbruce@ucdavis.edu#ifdef _MSC_VER
714299Sbbruce@ucdavis.edu// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to catch
814299Sbbruce@ucdavis.edu// 2.0.1; this should be fixed in the next catch release after 2.0.1).
914299Sbbruce@ucdavis.edu#  pragma warning(disable: 4996)
1014299Sbbruce@ucdavis.edu#endif
1114299Sbbruce@ucdavis.edu
1212391Sjason@lowepower.com#define CATCH_CONFIG_RUNNER
1312391Sjason@lowepower.com#include <catch.hpp>
1412391Sjason@lowepower.com
1512391Sjason@lowepower.comnamespace py = pybind11;
1612391Sjason@lowepower.com
1714299Sbbruce@ucdavis.eduint main(int argc, char *argv[]) {
1812391Sjason@lowepower.com    py::scoped_interpreter guard{};
1912391Sjason@lowepower.com    auto result = Catch::Session().run(argc, argv);
2012391Sjason@lowepower.com
2112391Sjason@lowepower.com    return result < 0xff ? result : 0xff;
2212391Sjason@lowepower.com}
23