Remove unneeded interface IRunner

This commit is contained in:
Martin Hořeňovský 2021-05-13 09:14:26 +02:00
parent b36f8daaad
commit 28f6698ec8
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
8 changed files with 2 additions and 46 deletions

View File

@ -80,7 +80,6 @@ set(INTERNAL_HEADERS
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_runner.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
${SOURCES_DIR}/internal/catch_lazy_expr.hpp

View File

@ -31,7 +31,6 @@
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <catch2/interfaces/catch_interfaces_runner.hpp>
#include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
#include <catch2/interfaces/catch_interfaces_testcase.hpp>

View File

@ -63,17 +63,6 @@ namespace Catch {
}
//////////////////////////////////////////////////
// vvv formerly catch_interfaces_runner.cpp vvv //
//////////////////////////////////////////////////
#include <catch2/interfaces/catch_interfaces_runner.hpp>
namespace Catch {
IRunner::~IRunner() = default;
}
////////////////////////////////////////////////////
// vvv formerly catch_interfaces_testcase.cpp vvv //
////////////////////////////////////////////////////

View File

@ -1,19 +0,0 @@
// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
#ifndef CATCH_INTERFACES_RUNNER_HPP_INCLUDED
#define CATCH_INTERFACES_RUNNER_HPP_INCLUDED
namespace Catch {
struct IRunner {
virtual ~IRunner();
virtual bool aborting() const = 0;
};
}
#endif // CATCH_INTERFACES_RUNNER_HPP_INCLUDED

View File

@ -17,9 +17,6 @@ namespace Catch {
IResultCapture* getResultCapture() override {
return m_resultCapture;
}
IRunner* getRunner() override {
return m_runner;
}
IConfig const* getConfig() const override {
return m_config;
@ -31,9 +28,6 @@ namespace Catch {
void setResultCapture( IResultCapture* resultCapture ) override {
m_resultCapture = resultCapture;
}
void setRunner( IRunner* runner ) override {
m_runner = runner;
}
void setConfig( IConfig const* config ) override {
m_config = config;
}
@ -42,7 +36,6 @@ namespace Catch {
private:
IConfig const* m_config = nullptr;
IRunner* m_runner = nullptr;
IResultCapture* m_resultCapture = nullptr;
};

View File

@ -11,7 +11,6 @@
namespace Catch {
struct IResultCapture;
struct IRunner;
struct IConfig;
struct IContext
@ -19,7 +18,6 @@ namespace Catch {
virtual ~IContext(); // = default
virtual IResultCapture* getResultCapture() = 0;
virtual IRunner* getRunner() = 0;
virtual IConfig const* getConfig() const = 0;
};
@ -27,7 +25,6 @@ namespace Catch {
{
virtual ~IMutableContext(); // = default
virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
virtual void setRunner( IRunner* runner ) = 0;
virtual void setConfig( IConfig const* config ) = 0;
private:

View File

@ -167,7 +167,6 @@ namespace Catch {
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
{
m_context.setRunner(this);
m_context.setResultCapture(this);
m_reporter->testRunStarting(m_runInfo);
}

View File

@ -8,7 +8,6 @@
#ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED
#define CATCH_RUN_CONTEXT_HPP_INCLUDED
#include <catch2/interfaces/catch_interfaces_runner.hpp>
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <catch2/internal/catch_test_registry.hpp>
#include <catch2/internal/catch_fatal_condition_handler.hpp>
@ -30,7 +29,7 @@ namespace Catch {
///////////////////////////////////////////////////////////////////////////
class RunContext : public IResultCapture, public IRunner {
class RunContext : public IResultCapture {
public:
RunContext( RunContext const& ) = delete;
@ -102,7 +101,7 @@ namespace Catch {
public:
// !TBD We need to do this another way!
bool aborting() const override;
bool aborting() const;
private: