diff --git a/Test/catch_hub_impl.hpp b/Test/catch_hub_impl.hpp new file mode 100644 index 00000000..722b140e --- /dev/null +++ b/Test/catch_hub_impl.hpp @@ -0,0 +1,31 @@ +/* + * catch_hub_impl.hpp + * Test + * + * Created by Phil on 31/12/2010. + * Copyright 2010 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + */ +#ifndef TWOBLUECUBES_CATCH_HUB_IMPL_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_HUB_IMPL_HPP_INCLUDED + +#include "catch_hub.h" +#include "catch_reporter_registry.hpp"a + +namespace Catch +{ + inline Hub::Hub() + : m_reporterRegistry( new ReporterRegistry ) + { + } + + inline IReporterRegistry& Hub::getReporterRegistry() + { + return *me().m_reporterRegistry.get(); + } +} + +#endif // TWOBLUECUBES_CATCH_HUB_IMPL_HPP_INCLUDED \ No newline at end of file diff --git a/catch.hpp b/catch.hpp index accc8a64..11a34042 100644 --- a/catch.hpp +++ b/catch.hpp @@ -26,7 +26,7 @@ #ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED #define TWOBLUECUBES_CATCH_HPP_INCLUDED -#include "internal/catch_hub.hpp" +#include "internal/catch_hub.h" #include "internal/catch_registry.hpp" #include "internal/catch_capture.hpp" #include "internal/catch_section.hpp" diff --git a/catch_runner.hpp b/catch_runner.hpp index 79905098..bff7b003 100644 --- a/catch_runner.hpp +++ b/catch_runner.hpp @@ -18,6 +18,7 @@ #include "catch_reporter_basic.hpp" #include "catch_reporter_xml.hpp" #include "catch_reporter_junit.hpp" +#include "catch_hub_impl.hpp" #include diff --git a/internal/catch_hub.hpp b/internal/catch_hub.h similarity index 64% rename from internal/catch_hub.hpp rename to internal/catch_hub.h index 8119e904..bc258ad6 100644 --- a/internal/catch_hub.hpp +++ b/internal/catch_hub.h @@ -1,5 +1,5 @@ /* - * catch_hub.hpp + * catch_hub.h * Test * * Created by Phil on 31/12/2010. @@ -9,8 +9,8 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ -#ifndef TWOBLUECUBES_CATCH_HUB_HPP_INCLUDED -#define TWOBLUECUBES_CATCH_HUB_HPP_INCLUDED +#ifndef TWOBLUECUBES_CATCH_HUB_H_INCLUDED +#define TWOBLUECUBES_CATCH_HUB_H_INCLUDED #include @@ -38,22 +38,5 @@ namespace Catch std::auto_ptr m_reporterRegistry; }; } - - ////// -- new file -- -#include "catch_reporter_registry.hpp" - -namespace Catch -{ - inline Hub::Hub() - : m_reporterRegistry( new ReporterRegistry ) - { - } - - inline IReporterRegistry& Hub::getReporterRegistry() - { - return *me().m_reporterRegistry.get(); - } -} - -#endif // TWOBLUECUBES_CATCH_HUB_HPP_INCLUDED \ No newline at end of file +#endif // TWOBLUECUBES_CATCH_HUB_H_INCLUDED \ No newline at end of file diff --git a/internal/catch_list.hpp b/internal/catch_list.hpp index 4b07cf9f..d8470e6d 100644 --- a/internal/catch_list.hpp +++ b/internal/catch_list.hpp @@ -23,8 +23,8 @@ namespace Catch if( config.listWhat() & RunnerConfig::listReports ) { std::cout << "Available reports:\n"; - ReporterRegistry::FactoryMap::const_iterator it = Hub::getReporterRegistry().getFactories().begin(); - ReporterRegistry::FactoryMap::const_iterator itEnd = Hub::getReporterRegistry().getFactories().end(); + IReporterRegistry::FactoryMap::const_iterator it = Hub::getReporterRegistry().getFactories().begin(); + IReporterRegistry::FactoryMap::const_iterator itEnd = Hub::getReporterRegistry().getFactories().end(); for(; it != itEnd; ++it ) { // !TBD: consider listAs() diff --git a/internal/catch_reporter_registrars.hpp b/internal/catch_reporter_registrars.hpp index 7b233803..60725ad9 100644 --- a/internal/catch_reporter_registrars.hpp +++ b/internal/catch_reporter_registrars.hpp @@ -12,7 +12,7 @@ #ifndef TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED -#include "catch_hub.hpp" +#include "catch_hub.h" namespace Catch {