X12-CustomDebugBreakMacro.cpp 648 B

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