Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/interfaces
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-02-23 23:46:45 +0100
committerMartin Hořeňovský2022-03-06 16:34:13 +0100
commit61d0f7a9afb88c12f8931f80321e58f2cfbc62db (patch)
treecdb5f8f3a86c99dd56c5dcb14a05b3f5751b1e9b /src/catch2/interfaces
parent9b01c404f514782383ec064c57a0a8e7d326f476 (diff)
downloadcatch3-61d0f7a9afb88c12f8931f80321e58f2cfbc62db.tar.gz
Pass the whole IStream wrapper into reporter
This will become useful when reworking colour support, because Win32 colour support requires checking whether the output is stdout, which is done through the `IStream` wrapper.
Diffstat (limited to 'src/catch2/interfaces')
-rw-r--r--src/catch2/interfaces/catch_interfaces_config.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.cpp6
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp7
3 files changed, 9 insertions, 7 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_config.hpp b/src/catch2/interfaces/catch_interfaces_config.hpp
index 4b2bd365..6c17081a 100644
--- a/src/catch2/interfaces/catch_interfaces_config.hpp
+++ b/src/catch2/interfaces/catch_interfaces_config.hpp
@@ -55,13 +55,14 @@ namespace Catch {
}; };
class TestSpec;
+ class IStream;
struct IConfig : Detail::NonCopyable {
virtual ~IConfig();
virtual bool allowThrows() const = 0;
- virtual std::ostream& defaultStream() const = 0;
+ virtual IStream const* defaultStream() const = 0;
virtual StringRef name() const = 0;
virtual bool includeSuccessfulResults() const = 0;
virtual bool shouldDebugBreak() const = 0;
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp
index e5d3921f..5f5d274a 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.cpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp
@@ -20,10 +20,10 @@
namespace Catch {
- ReporterConfig::ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream )
- : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
+ ReporterConfig::ReporterConfig( IConfig const* _fullConfig, IStream const* _stream )
+ : m_stream( _stream ), m_fullConfig( _fullConfig ) {}
- std::ostream& ReporterConfig::stream() const { return *m_stream; }
+ IStream const* ReporterConfig::stream() const { return m_stream; }
IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp
index c05648b7..41cf426b 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp
@@ -30,15 +30,16 @@ namespace Catch {
struct TestCaseInfo;
class TestCaseHandle;
struct IConfig;
+ class IStream;
struct ReporterConfig {
- ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream );
+ ReporterConfig( IConfig const* _fullConfig, IStream const* _stream );
- std::ostream& stream() const;
+ IStream const* stream() const;
IConfig const* fullConfig() const;
private:
- std::ostream* m_stream;
+ IStream const* m_stream;
IConfig const* m_fullConfig;
};