1 /* 2 * Created by Martin on 04/06/2017. 3 * Copyright 2017 Two Blue Cubes Ltd. All rights reserved. 4 * 5 * Distributed under the Boost Software License, Version 1.0. (See accompanying 6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 */ 8 9 #include "catch_startup_exception_registry.h" 10 #include "catch_compiler_capabilities.h" 11 12 #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) 13 namespace Catch { add(std::exception_ptr const & exception)14void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept { 15 CATCH_TRY { 16 m_exceptions.push_back(exception); 17 } CATCH_CATCH_ALL { 18 // If we run out of memory during start-up there's really not a lot more we can do about it 19 std::terminate(); 20 } 21 } 22 getExceptions() const23 std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept { 24 return m_exceptions; 25 } 26 27 } // end namespace Catch 28 #endif 29