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 namespace Catch {
add(std::exception_ptr const & exception)13 void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
14         CATCH_TRY {
15             m_exceptions.push_back(exception);
16         } CATCH_CATCH_ALL {
17             // If we run out of memory during start-up there's really not a lot more we can do about it
18             std::terminate();
19         }
20     }
21 
getExceptions() const22     std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
23         return m_exceptions;
24     }
25 
26 } // end namespace Catch
27