File: catch.cpp

package info (click to toggle)
gridtools 2.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,264 kB
  • sloc: cpp: 107,228; python: 17,464; javascript: 9,164; ansic: 4,227; sh: 850; f90: 393; makefile: 230
file content (27 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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

// Catch uses _ internally, which breaks gettext style defines
#ifdef _
#    undef _
#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;
}