catch2/internal/catch_hub_impl.hpp

74 lines
1.9 KiB
C++
Raw Normal View History

/*
* catch_hub_impl.hpp
2011-01-11 10:13:31 +01:00
* Catch
*
* 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)
*
*/
#include "catch_hub.h"
2011-01-07 11:22:24 +01:00
#include "catch_reporter_registry.hpp"
#include "catch_test_case_registry_impl.hpp"
2011-01-11 10:13:31 +01:00
#include "catch_runner_impl.hpp"
namespace Catch
{
2011-01-07 11:01:40 +01:00
///////////////////////////////////////////////////////////////////////////
2011-01-07 11:22:24 +01:00
Hub::Hub
()
2011-01-07 11:01:40 +01:00
: m_reporterRegistry( new ReporterRegistry ),
m_testCaseRegistry( new TestRegistry )
{
}
2011-01-11 10:13:31 +01:00
2011-01-07 11:22:24 +01:00
///////////////////////////////////////////////////////////////////////////
Hub& Hub::me
()
2011-01-07 11:01:40 +01:00
{
static Hub hub;
return hub;
}
2011-01-11 10:13:31 +01:00
///////////////////////////////////////////////////////////////////////////
void Hub::setRunner( IRunner* runner )
{
me().m_runner = runner;
}
///////////////////////////////////////////////////////////////////////////
void Hub::setResultCapture( IResultCapture* resultCapture )
{
me().m_resultCapture = resultCapture;
}
///////////////////////////////////////////////////////////////////////////
IResultCapture& Hub::getResultCapture
()
{
return *me().m_resultCapture;
}
///////////////////////////////////////////////////////////////////////////
IRunner& Hub::getRunner
()
{
return *me().m_runner;
}
2011-01-07 11:22:24 +01:00
///////////////////////////////////////////////////////////////////////////
IReporterRegistry& Hub::getReporterRegistry
()
{
return *me().m_reporterRegistry.get();
}
2011-01-07 11:01:40 +01:00
///////////////////////////////////////////////////////////////////////////
2011-01-07 11:22:24 +01:00
ITestCaseRegistry& Hub::getTestCaseRegistry
()
2011-01-07 11:01:40 +01:00
{
2011-01-07 11:22:24 +01:00
return *me().m_testCaseRegistry.get();
2011-01-07 11:01:40 +01:00
}
}