mirror of
https://github.com/catchorg/Catch2.git
synced 2025-04-28 19:53:52 +00:00
Compare commits
3 Commits
5eb7aa4f90
...
28f6698ec8
Author | SHA1 | Date | |
---|---|---|---|
|
28f6698ec8 | ||
|
b36f8daaad | ||
|
d86cb5f95d |
@ -80,7 +80,6 @@ set(INTERNAL_HEADERS
|
|||||||
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
|
||||||
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
|
||||||
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.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_tag_alias_registry.hpp
|
||||||
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
|
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
|
||||||
${SOURCES_DIR}/internal/catch_lazy_expr.hpp
|
${SOURCES_DIR}/internal/catch_lazy_expr.hpp
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||||
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
|
#include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
|
||||||
#include <catch2/interfaces/catch_interfaces_reporter_registry.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_tag_alias_registry.hpp>
|
||||||
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
|
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
|
||||||
|
|
||||||
|
@ -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 //
|
// vvv formerly catch_interfaces_testcase.cpp vvv //
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
|
@ -26,7 +26,7 @@ namespace Catch {
|
|||||||
} // namespace Detail
|
} // namespace Detail
|
||||||
|
|
||||||
struct IMutableEnumValuesRegistry {
|
struct IMutableEnumValuesRegistry {
|
||||||
virtual ~IMutableEnumValuesRegistry();
|
virtual ~IMutableEnumValuesRegistry(); // = default;
|
||||||
|
|
||||||
virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
|
virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ namespace Catch {
|
|||||||
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
|
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
|
||||||
|
|
||||||
struct IExceptionTranslator {
|
struct IExceptionTranslator {
|
||||||
virtual ~IExceptionTranslator();
|
virtual ~IExceptionTranslator(); // = default
|
||||||
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
|
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IExceptionTranslatorRegistry {
|
struct IExceptionTranslatorRegistry {
|
||||||
virtual ~IExceptionTranslatorRegistry();
|
virtual ~IExceptionTranslatorRegistry(); // = default
|
||||||
|
|
||||||
virtual std::string translateActiveException() const = 0;
|
virtual std::string translateActiveException() const = 0;
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ namespace Catch {
|
|||||||
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
|
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
|
||||||
|
|
||||||
struct IRegistryHub {
|
struct IRegistryHub {
|
||||||
virtual ~IRegistryHub();
|
virtual ~IRegistryHub(); // = default
|
||||||
|
|
||||||
virtual IReporterRegistry const& getReporterRegistry() const = 0;
|
virtual IReporterRegistry const& getReporterRegistry() const = 0;
|
||||||
virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
|
virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
|
||||||
@ -43,7 +43,7 @@ namespace Catch {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct IMutableRegistryHub {
|
struct IMutableRegistryHub {
|
||||||
virtual ~IMutableRegistryHub();
|
virtual ~IMutableRegistryHub(); // = default
|
||||||
virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0;
|
virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0;
|
||||||
virtual void registerListener( IReporterFactoryPtr factory ) = 0;
|
virtual void registerListener( IReporterFactoryPtr factory ) = 0;
|
||||||
virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0;
|
virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0;
|
||||||
|
@ -27,7 +27,7 @@ namespace Catch {
|
|||||||
using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
|
using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
|
||||||
using Listeners = std::vector<IReporterFactoryPtr>;
|
using Listeners = std::vector<IReporterFactoryPtr>;
|
||||||
|
|
||||||
virtual ~IReporterRegistry();
|
virtual ~IReporterRegistry(); // = default
|
||||||
virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0;
|
virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0;
|
||||||
virtual FactoryMap const& getFactories() const = 0;
|
virtual FactoryMap const& getFactories() const = 0;
|
||||||
virtual Listeners const& getListeners() const = 0;
|
virtual Listeners const& getListeners() const = 0;
|
||||||
|
@ -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
|
|
@ -15,7 +15,7 @@ namespace Catch {
|
|||||||
struct TagAlias;
|
struct TagAlias;
|
||||||
|
|
||||||
struct ITagAliasRegistry {
|
struct ITagAliasRegistry {
|
||||||
virtual ~ITagAliasRegistry();
|
virtual ~ITagAliasRegistry(); // = default
|
||||||
// Nullptr if not present
|
// Nullptr if not present
|
||||||
virtual TagAlias const* find( std::string const& alias ) const = 0;
|
virtual TagAlias const* find( std::string const& alias ) const = 0;
|
||||||
virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
|
virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
|
||||||
|
@ -17,14 +17,14 @@ namespace Catch {
|
|||||||
|
|
||||||
struct ITestInvoker {
|
struct ITestInvoker {
|
||||||
virtual void invoke () const = 0;
|
virtual void invoke () const = 0;
|
||||||
virtual ~ITestInvoker();
|
virtual ~ITestInvoker(); // = default
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestCaseHandle;
|
class TestCaseHandle;
|
||||||
struct IConfig;
|
struct IConfig;
|
||||||
|
|
||||||
struct ITestCaseRegistry {
|
struct ITestCaseRegistry {
|
||||||
virtual ~ITestCaseRegistry();
|
virtual ~ITestCaseRegistry(); // = default
|
||||||
// TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later
|
// TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later
|
||||||
virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0;
|
virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0;
|
||||||
virtual std::vector<TestCaseHandle> const& getAllTests() const = 0;
|
virtual std::vector<TestCaseHandle> const& getAllTests() const = 0;
|
||||||
|
@ -17,9 +17,6 @@ namespace Catch {
|
|||||||
IResultCapture* getResultCapture() override {
|
IResultCapture* getResultCapture() override {
|
||||||
return m_resultCapture;
|
return m_resultCapture;
|
||||||
}
|
}
|
||||||
IRunner* getRunner() override {
|
|
||||||
return m_runner;
|
|
||||||
}
|
|
||||||
|
|
||||||
IConfig const* getConfig() const override {
|
IConfig const* getConfig() const override {
|
||||||
return m_config;
|
return m_config;
|
||||||
@ -31,9 +28,6 @@ namespace Catch {
|
|||||||
void setResultCapture( IResultCapture* resultCapture ) override {
|
void setResultCapture( IResultCapture* resultCapture ) override {
|
||||||
m_resultCapture = resultCapture;
|
m_resultCapture = resultCapture;
|
||||||
}
|
}
|
||||||
void setRunner( IRunner* runner ) override {
|
|
||||||
m_runner = runner;
|
|
||||||
}
|
|
||||||
void setConfig( IConfig const* config ) override {
|
void setConfig( IConfig const* config ) override {
|
||||||
m_config = config;
|
m_config = config;
|
||||||
}
|
}
|
||||||
@ -42,7 +36,6 @@ namespace Catch {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
IConfig const* m_config = nullptr;
|
IConfig const* m_config = nullptr;
|
||||||
IRunner* m_runner = nullptr;
|
|
||||||
IResultCapture* m_resultCapture = nullptr;
|
IResultCapture* m_resultCapture = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,23 +11,20 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct IResultCapture;
|
struct IResultCapture;
|
||||||
struct IRunner;
|
|
||||||
struct IConfig;
|
struct IConfig;
|
||||||
|
|
||||||
struct IContext
|
struct IContext
|
||||||
{
|
{
|
||||||
virtual ~IContext();
|
virtual ~IContext(); // = default
|
||||||
|
|
||||||
virtual IResultCapture* getResultCapture() = 0;
|
virtual IResultCapture* getResultCapture() = 0;
|
||||||
virtual IRunner* getRunner() = 0;
|
|
||||||
virtual IConfig const* getConfig() const = 0;
|
virtual IConfig const* getConfig() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IMutableContext : IContext
|
struct IMutableContext : IContext
|
||||||
{
|
{
|
||||||
virtual ~IMutableContext();
|
virtual ~IMutableContext(); // = default
|
||||||
virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
|
virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
|
||||||
virtual void setRunner( IRunner* runner ) = 0;
|
|
||||||
virtual void setConfig( IConfig const* config ) = 0;
|
virtual void setConfig( IConfig const* config ) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {}
|
IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default;
|
||||||
|
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace Catch {
|
|||||||
|
|
||||||
class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
|
class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
|
||||||
public:
|
public:
|
||||||
~ExceptionTranslatorRegistry();
|
~ExceptionTranslatorRegistry() override;
|
||||||
void registerTranslator( const IExceptionTranslator* translator );
|
void registerTranslator( const IExceptionTranslator* translator );
|
||||||
std::string translateActiveException() const override;
|
std::string translateActiveException() const override;
|
||||||
std::string tryTranslators() const;
|
std::string tryTranslators() const;
|
||||||
|
@ -167,7 +167,6 @@ namespace Catch {
|
|||||||
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
|
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
|
||||||
m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
|
m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
|
||||||
{
|
{
|
||||||
m_context.setRunner(this);
|
|
||||||
m_context.setResultCapture(this);
|
m_context.setResultCapture(this);
|
||||||
m_reporter->testRunStarting(m_runInfo);
|
m_reporter->testRunStarting(m_runInfo);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED
|
#ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED
|
||||||
#define 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/interfaces/catch_interfaces_reporter.hpp>
|
||||||
#include <catch2/internal/catch_test_registry.hpp>
|
#include <catch2/internal/catch_test_registry.hpp>
|
||||||
#include <catch2/internal/catch_fatal_condition_handler.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:
|
public:
|
||||||
RunContext( RunContext const& ) = delete;
|
RunContext( RunContext const& ) = delete;
|
||||||
@ -102,7 +101,7 @@ namespace Catch {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// !TBD We need to do this another way!
|
// !TBD We need to do this another way!
|
||||||
bool aborting() const override;
|
bool aborting() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ISingleton::~ISingleton() {}
|
ISingleton::~ISingleton() = default;
|
||||||
|
|
||||||
void addSingleton(ISingleton* singleton ) {
|
void addSingleton(ISingleton* singleton ) {
|
||||||
getSingletons()->push_back( singleton );
|
getSingletons()->push_back( singleton );
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct ISingleton {
|
struct ISingleton {
|
||||||
virtual ~ISingleton();
|
virtual ~ISingleton(); // = default
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace Catch {
|
|||||||
std::ostream& clog();
|
std::ostream& clog();
|
||||||
|
|
||||||
struct IStream {
|
struct IStream {
|
||||||
virtual ~IStream();
|
virtual ~IStream(); // = default
|
||||||
virtual std::ostream& stream() const = 0;
|
virtual std::ostream& stream() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ namespace Catch {
|
|||||||
<< "\tRedefined at: " << lineInfo );
|
<< "\tRedefined at: " << lineInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
ITagAliasRegistry::~ITagAliasRegistry() {}
|
ITagAliasRegistry::~ITagAliasRegistry() = default;
|
||||||
|
|
||||||
ITagAliasRegistry const& ITagAliasRegistry::get() {
|
ITagAliasRegistry const& ITagAliasRegistry::get() {
|
||||||
return getRegistryHub().getTagAliasRegistry();
|
return getRegistryHub().getTagAliasRegistry();
|
||||||
|
@ -51,7 +51,7 @@ namespace TestCaseTracking {
|
|||||||
return m_nameAndLocation;
|
return m_nameAndLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~ITracker();
|
virtual ~ITracker(); // = default
|
||||||
|
|
||||||
|
|
||||||
// dynamic queries
|
// dynamic queries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user