catch_startup_exception_registry.cpp 916 B

12345678910111213141516171819202122232425262728
  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. #include "catch_startup_exception_registry.h"
  9. #include "catch_compiler_capabilities.h"
  10. #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
  11. namespace Catch {
  12. void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
  13. CATCH_TRY {
  14. m_exceptions.push_back(exception);
  15. } CATCH_CATCH_ALL {
  16. // If we run out of memory during start-up there's really not a lot more we can do about it
  17. std::terminate();
  18. }
  19. }
  20. std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
  21. return m_exceptions;
  22. }
  23. } // end namespace Catch
  24. #endif