Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 1 | /* |
| 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 Nash | 3b80af7 | 2012-08-09 07:47:30 +0100 | [diff] [blame] | 8 | #ifndef TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED |
| 9 | #define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED |
Phil Nash | 5234b15 | 2012-08-06 08:33:15 +0100 | [diff] [blame] | 10 | |
Phil Nash | afcc38e | 2015-08-07 17:28:48 +0100 | [diff] [blame] | 11 | #include "catch_ptr.hpp" |
Phil Nash | 368714e | 2015-08-07 08:20:56 +0100 | [diff] [blame] | 12 | |
Phil Nash | c4a089c | 2013-12-03 18:52:41 +0000 | [diff] [blame] | 13 | #include <string> |
Phil Nash | 5234b15 | 2012-08-06 08:33:15 +0100 | [diff] [blame] | 14 | |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 15 | namespace Catch { |
Phil Nash | 5234b15 | 2012-08-06 08:33:15 +0100 | [diff] [blame] | 16 | |
Phil Nash | 06a671a | 2012-11-22 19:17:20 +0000 | [diff] [blame] | 17 | class TestCase; |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 18 | struct ITestCaseRegistry; |
| 19 | struct IExceptionTranslatorRegistry; |
| 20 | struct IExceptionTranslator; |
Phil Nash | c4a089c | 2013-12-03 18:52:41 +0000 | [diff] [blame] | 21 | struct IReporterRegistry; |
| 22 | struct IReporterFactory; |
Phil Nash | 4ec8d53 | 2017-03-15 09:45:37 +0000 | [diff] [blame^] | 23 | struct ITagAliasRegistry; |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 24 | |
Phil Nash | da0ae95 | 2012-08-07 07:58:34 +0100 | [diff] [blame] | 25 | struct IRegistryHub { |
Phil Nash | a695eb9 | 2012-08-13 07:46:10 +0100 | [diff] [blame] | 26 | virtual ~IRegistryHub(); |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 27 | |
Phil Nash | 2a9d8d9 | 2013-04-23 18:58:56 +0100 | [diff] [blame] | 28 | virtual IReporterRegistry const& getReporterRegistry() const = 0; |
| 29 | virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; |
Phil Nash | 4ec8d53 | 2017-03-15 09:45:37 +0000 | [diff] [blame^] | 30 | virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0; |
| 31 | |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 32 | virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; |
| 33 | }; |
| 34 | |
Phil Nash | da0ae95 | 2012-08-07 07:58:34 +0100 | [diff] [blame] | 35 | struct IMutableRegistryHub { |
Phil Nash | a695eb9 | 2012-08-13 07:46:10 +0100 | [diff] [blame] | 36 | virtual ~IMutableRegistryHub(); |
Phil Nash | 368714e | 2015-08-07 08:20:56 +0100 | [diff] [blame] | 37 | virtual void registerReporter( std::string const& name, Ptr<IReporterFactory> const& factory ) = 0; |
| 38 | virtual void registerListener( Ptr<IReporterFactory> const& factory ) = 0; |
Phil Nash | 2a9d8d9 | 2013-04-23 18:58:56 +0100 | [diff] [blame] | 39 | virtual void registerTest( TestCase const& testInfo ) = 0; |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 40 | virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; |
Phil Nash | 4ec8d53 | 2017-03-15 09:45:37 +0000 | [diff] [blame^] | 41 | virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 42 | }; |
| 43 | |
Phil Nash | da0ae95 | 2012-08-07 07:58:34 +0100 | [diff] [blame] | 44 | IRegistryHub& getRegistryHub(); |
| 45 | IMutableRegistryHub& getMutableRegistryHub(); |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 46 | void cleanUp(); |
Phil Nash | c96f933 | 2012-10-17 08:14:22 +0100 | [diff] [blame] | 47 | std::string translateActiveException(); |
| 48 | |
Phil Nash | 1091ca8 | 2012-08-06 20:16:53 +0100 | [diff] [blame] | 49 | } |
| 50 | |
Phil Nash | 3b80af7 | 2012-08-09 07:47:30 +0100 | [diff] [blame] | 51 | #endif // TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED |