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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
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/internal
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/internal')
-rw-r--r--src/catch2/internal/catch_console_colour.cpp2
-rw-r--r--src/catch2/internal/catch_stream.hpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp
index b3e4934e..b3d583d2 100644
--- a/src/catch2/internal/catch_console_colour.cpp
+++ b/src/catch2/internal/catch_console_colour.cpp
@@ -160,7 +160,7 @@ namespace {
void setColour( const char* _escapeCode ) {
// The escape sequence must be flushed to console, otherwise if
// stdin and stderr are intermixed, we'd get accidentally coloured output.
- getCurrentContext().getConfig()->defaultStream()
+ getCurrentContext().getConfig()->defaultStream()->stream()
<< '\033' << _escapeCode << std::flush;
}
};
diff --git a/src/catch2/internal/catch_stream.hpp b/src/catch2/internal/catch_stream.hpp
index 77a35760..1b92b4dc 100644
--- a/src/catch2/internal/catch_stream.hpp
+++ b/src/catch2/internal/catch_stream.hpp
@@ -22,7 +22,8 @@ namespace Catch {
std::ostream& cerr();
std::ostream& clog();
- struct IStream {
+ class IStream {
+ public:
virtual ~IStream(); // = default
virtual std::ostream& stream() const = 0;
// Win32 colour supports requires us to identify whether a stream