blob: 5e0a7f01a896d7d580701a8d49165404572dff6a [file] [log] [blame]
Phil Nash1091ca82012-08-06 20:16:53 +01001/*
2 * Created by Phil on 5/8/2012.
3 * Copyright 2012 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 */
Phil Nash3b80af72012-08-09 07:47:30 +01008#ifndef TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
9#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
Phil Nash5234b152012-08-06 08:33:15 +010010
Phil Nashafcc38e2015-08-07 17:28:48 +010011#include "catch_ptr.hpp"
Phil Nash368714e2015-08-07 08:20:56 +010012
Phil Nashc4a089c2013-12-03 18:52:41 +000013#include <string>
Phil Nash5234b152012-08-06 08:33:15 +010014
Phil Nash1091ca82012-08-06 20:16:53 +010015namespace Catch {
Phil Nash5234b152012-08-06 08:33:15 +010016
Phil Nash06a671a2012-11-22 19:17:20 +000017 class TestCase;
Phil Nash1091ca82012-08-06 20:16:53 +010018 struct ITestCaseRegistry;
19 struct IExceptionTranslatorRegistry;
20 struct IExceptionTranslator;
Phil Nashc4a089c2013-12-03 18:52:41 +000021 struct IReporterRegistry;
22 struct IReporterFactory;
Phil Nash4ec8d532017-03-15 09:45:37 +000023 struct ITagAliasRegistry;
Phil Nash1091ca82012-08-06 20:16:53 +010024
Phil Nashda0ae952012-08-07 07:58:34 +010025 struct IRegistryHub {
Phil Nasha695eb92012-08-13 07:46:10 +010026 virtual ~IRegistryHub();
Phil Nash1091ca82012-08-06 20:16:53 +010027
Phil Nash2a9d8d92013-04-23 18:58:56 +010028 virtual IReporterRegistry const& getReporterRegistry() const = 0;
29 virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
Phil Nash4ec8d532017-03-15 09:45:37 +000030 virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
31
Phil Nash1091ca82012-08-06 20:16:53 +010032 virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0;
33 };
34
Phil Nashda0ae952012-08-07 07:58:34 +010035 struct IMutableRegistryHub {
Phil Nasha695eb92012-08-13 07:46:10 +010036 virtual ~IMutableRegistryHub();
Phil Nash368714e2015-08-07 08:20:56 +010037 virtual void registerReporter( std::string const& name, Ptr<IReporterFactory> const& factory ) = 0;
38 virtual void registerListener( Ptr<IReporterFactory> const& factory ) = 0;
Phil Nash2a9d8d92013-04-23 18:58:56 +010039 virtual void registerTest( TestCase const& testInfo ) = 0;
Phil Nash1091ca82012-08-06 20:16:53 +010040 virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
Phil Nash4ec8d532017-03-15 09:45:37 +000041 virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
Phil Nash1091ca82012-08-06 20:16:53 +010042 };
43
Phil Nashda0ae952012-08-07 07:58:34 +010044 IRegistryHub& getRegistryHub();
45 IMutableRegistryHub& getMutableRegistryHub();
Phil Nash1091ca82012-08-06 20:16:53 +010046 void cleanUp();
Phil Nashc96f9332012-10-17 08:14:22 +010047 std::string translateActiveException();
48
Phil Nash1091ca82012-08-06 20:16:53 +010049}
50
Phil Nash3b80af72012-08-09 07:47:30 +010051#endif // TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED