blob: e1b18db845c27e8a5d293db523ffe735af3aa525 [file] [log] [blame]
Jan Kundrát5c805212018-03-02 13:57:12 +01001#define CATCH_CONFIG_MAIN
Jan Kundrátc381e632019-03-14 13:39:11 +01002#include <catch2/catch.hpp>
3#include <sstream>
4#include <trompeloeil.hpp>
5
6namespace trompeloeil
7 {
8 template <>
9 void reporter<specialized>::send(
10 severity s,
11 const char* file,
12 unsigned long line,
13 const char* msg)
14 {
15 std::ostringstream os;
16 if (line) os << file << ':' << line << '\n';
17 os << msg;
18 auto failure = os.str();
19 if (s == severity::fatal)
20 {
21 FAIL(failure);
22 }
23 else
24 {
25 CAPTURE(failure);
26 CHECK(failure.empty());
27 }
28 }
29 }