| 1 |
|
| 2 |
// Copyright Catch2 Authors |
| 3 |
// Distributed under the Boost Software License, Version 1.0. |
| 4 |
// (See accompanying file LICENSE.txt or copy at |
| 5 |
// https://www.boost.org/LICENSE_1_0.txt) |
| 6 |
|
| 7 |
// SPDX-License-Identifier: BSL-1.0 |
| 8 |
|
| 9 |
/**\file |
| 10 |
* Test that user-defined `CATCH_BREAK_INTO_DEBUGGER` is respected and used. |
| 11 |
*/ |
| 12 |
|
| 13 |
#include <iostream> |
| 14 |
|
| 15 |
void custom_debug_break() { |
| 16 |
std::cerr << "Pretty please, break into debugger\n"; |
| 17 |
} |
| 18 |
|
| 19 |
#define CATCH_BREAK_INTO_DEBUGGER() custom_debug_break() |
| 20 |
|
| 21 |
#define CATCH_CONFIG_MAIN |
| 22 |
#include <catch2/catch.hpp> |
| 23 |
|
| 24 |
TEST_CASE("Failing test that breaks into debugger", "[macros]") { |
| 25 |
REQUIRE(1 == 2); |
| 26 |
} |