2017-06-04 21:39:27 +02:00
|
|
|
/*
|
|
|
|
* Created by Martin on 04/06/2017.
|
|
|
|
* Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "catch_startup_exception_registry.h"
|
2018-09-03 17:52:48 +02:00
|
|
|
#include "catch_compiler_capabilities.h"
|
2017-06-04 21:39:27 +02:00
|
|
|
|
2020-06-04 11:53:13 +02:00
|
|
|
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
2017-06-04 21:39:27 +02:00
|
|
|
namespace Catch {
|
2018-09-03 17:52:48 +02:00
|
|
|
void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
|
|
|
|
CATCH_TRY {
|
2017-07-13 09:25:47 +02:00
|
|
|
m_exceptions.push_back(exception);
|
2018-09-03 17:52:48 +02:00
|
|
|
} CATCH_CATCH_ALL {
|
2017-07-13 09:25:47 +02:00
|
|
|
// If we run out of memory during start-up there's really not a lot more we can do about it
|
|
|
|
std::terminate();
|
|
|
|
}
|
2017-06-04 21:39:27 +02:00
|
|
|
}
|
|
|
|
|
2017-07-13 09:25:47 +02:00
|
|
|
std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
|
2017-06-04 21:39:27 +02:00
|
|
|
return m_exceptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end namespace Catch
|
2020-06-04 11:53:13 +02:00
|
|
|
#endif
|