Split out Catch::cout/cerr/clog into their own file

This commit is contained in:
Martin Hořeňovský 2022-04-16 14:12:56 +02:00
parent b520257676
commit 05e85c5652
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
14 changed files with 66 additions and 19 deletions

View file

@ -8,11 +8,13 @@
#include <catch2/catch_test_macros.hpp>
#include <iostream>
namespace Catch {
[[noreturn]]
void throw_exception(std::exception const& e) {
Catch::cerr() << "====== CUSTOM HANDLER ====== run terminates because an exception was thrown.\n"
<< "The message was: " << e.what() << '\n';
std::cerr << "====== CUSTOM HANDLER ====== run terminates because an exception was thrown.\n"
<< "The message was: " << e.what() << '\n';
// Avoid abort and other exceptional exits -- there is no way
// to tell CMake that abort is the desired outcome of a test.
exit(1);