Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:04

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
0009 #define CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
0010 
0011 #include <catch2/internal/catch_unique_ptr.hpp>
0012 
0013 #include <string>
0014 
0015 namespace Catch {
0016 
0017     class TestCaseHandle;
0018     struct TestCaseInfo;
0019     class ITestCaseRegistry;
0020     class IExceptionTranslatorRegistry;
0021     class IExceptionTranslator;
0022     class ReporterRegistry;
0023     class IReporterFactory;
0024     class ITagAliasRegistry;
0025     class ITestInvoker;
0026     class IMutableEnumValuesRegistry;
0027     struct SourceLineInfo;
0028 
0029     class StartupExceptionRegistry;
0030     class EventListenerFactory;
0031 
0032     using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
0033 
0034     class IRegistryHub {
0035     public:
0036         virtual ~IRegistryHub(); // = default
0037 
0038         virtual ReporterRegistry const& getReporterRegistry() const = 0;
0039         virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
0040         virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
0041         virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0;
0042 
0043 
0044         virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
0045     };
0046 
0047     class IMutableRegistryHub {
0048     public:
0049         virtual ~IMutableRegistryHub(); // = default
0050         virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0;
0051         virtual void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) = 0;
0052         virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0;
0053         virtual void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) = 0;
0054         virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
0055         virtual void registerStartupException() noexcept = 0;
0056         virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
0057     };
0058 
0059     IRegistryHub const& getRegistryHub();
0060     IMutableRegistryHub& getMutableRegistryHub();
0061     void cleanUp();
0062     std::string translateActiveException();
0063 
0064 }
0065 
0066 #endif // CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED