File indexing completed on 2025-01-18 09:54:04
0001
0002
0003
0004
0005
0006
0007
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();
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();
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