Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 1 | #define CATCH_CONFIG_MAIN |
Jan Kundrát | c381e63 | 2019-03-14 13:39:11 +0100 | [diff] [blame] | 2 | #include <catch2/catch.hpp> |
| 3 | #include <sstream> |
| 4 | #include <trompeloeil.hpp> |
| 5 | |
| 6 | namespace 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 | } |