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

summaryrefslogtreecommitdiffhomepage
path: root/tests/ExtraTests
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-04-12 21:22:43 +0200
committerMartin Hořeňovský2022-04-13 15:00:50 +0200
commit79d1e8238135427a6780a6db2cdb8b9be0b7f086 (patch)
tree13b7a82bbad094af77171b2807b5d9241acc1721 /tests/ExtraTests
parent4f09f1120ba0a28f218a00821a8347a443042ecb (diff)
downloadcatch3-79d1e8238135427a6780a6db2cdb8b9be0b7f086.tar.gz
Store IStream instance owning ptrs in reporter instances
This ended up being a surprisingly large refactoring, motivated by removing a `const_cast` from `Config`'s handling of reporter streams, forced by previous commit.
Diffstat (limited to 'tests/ExtraTests')
-rw-r--r--tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp5
-rw-r--r--tests/ExtraTests/X23-CasingInReporterNames.cpp5
-rw-r--r--tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp5
-rw-r--r--tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp5
-rw-r--r--tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp6
-rw-r--r--tests/ExtraTests/X29-CustomArgumentsForReporters.cpp4
6 files changed, 18 insertions, 12 deletions
diff --git a/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp b/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp
index 2ef629bf..c75d891e 100644
--- a/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp
+++ b/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp
@@ -20,12 +20,13 @@
#include <catch2/reporters/catch_reporter_registrars.hpp>
#include <iostream>
+#include <utility>
class CumulativeBenchmarkReporter final : public Catch::CumulativeReporterBase {
public:
- CumulativeBenchmarkReporter(Catch::ReporterConfig const& _config) :
- CumulativeReporterBase(_config) {
+ CumulativeBenchmarkReporter(Catch::ReporterConfig&& _config) :
+ CumulativeReporterBase(std::move(_config)) {
m_preferences.shouldReportAllAssertions = true;
}
diff --git a/tests/ExtraTests/X23-CasingInReporterNames.cpp b/tests/ExtraTests/X23-CasingInReporterNames.cpp
index b5dcb403..0e13f205 100644
--- a/tests/ExtraTests/X23-CasingInReporterNames.cpp
+++ b/tests/ExtraTests/X23-CasingInReporterNames.cpp
@@ -19,11 +19,12 @@
#include <catch2/reporters/catch_reporter_registrars.hpp>
#include <iostream>
+#include <utility>
class TestReporter : public Catch::StreamingReporterBase {
public:
- TestReporter(Catch::ReporterConfig const& _config):
- StreamingReporterBase(_config) {
+ TestReporter(Catch::ReporterConfig&& _config):
+ StreamingReporterBase(std::move(_config)) {
std::cout << "TestReporter constructed\n";
}
diff --git a/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp b/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp
index af3a3202..01aca7c0 100644
--- a/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp
+++ b/tests/ExtraTests/X26-ReporterPreferencesForPassingAssertionsIsRespected.cpp
@@ -16,13 +16,14 @@
#include <catch2/reporters/catch_reporter_registrars.hpp>
#include <iostream>
+#include <utility>
namespace {
class TestReporter : public Catch::StreamingReporterBase {
public:
- TestReporter(Catch::ReporterConfig const& _config):
- StreamingReporterBase(_config) {
+ TestReporter(Catch::ReporterConfig&& _config):
+ StreamingReporterBase(std::move(_config)) {
m_preferences.shouldReportAllAssertions = false;
std::cout << "X26 - TestReporter constructed\n";
}
diff --git a/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp b/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp
index 871ed53c..cb29be0c 100644
--- a/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp
+++ b/tests/ExtraTests/X27-CapturedStdoutInTestCaseEvents.cpp
@@ -26,6 +26,7 @@
#include <iostream>
#include <string>
+#include <utility>
class TestReporter : public Catch::StreamingReporterBase {
std::string stdOutString( uint64_t iter ){
@@ -36,8 +37,8 @@ class TestReporter : public Catch::StreamingReporterBase {
}
public:
- TestReporter( Catch::ReporterConfig const& _config ):
- StreamingReporterBase( _config ) {
+ TestReporter( Catch::ReporterConfig&& _config ):
+ StreamingReporterBase( std::move(_config) ) {
m_preferences.shouldRedirectStdOut = true;
std::cout << "X27 - TestReporter constructed\n";
}
diff --git a/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp b/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp
index ce2d31eb..c8102edb 100644
--- a/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp
+++ b/tests/ExtraTests/X28-ListenersGetEventsBeforeReporters.cpp
@@ -19,7 +19,9 @@
#include <catch2/reporters/catch_reporter_event_listener.hpp>
#include <catch2/reporters/catch_reporter_registrars.hpp>
#include <catch2/reporters/catch_reporter_streaming_base.hpp>
+
#include <iostream>
+#include <utility>
namespace {
@@ -54,8 +56,8 @@ namespace {
class TestReporter : public Catch::StreamingReporterBase {
public:
- TestReporter( Catch::ReporterConfig const& _config ):
- StreamingReporterBase( _config ) {
+ TestReporter( Catch::ReporterConfig&& _config ):
+ StreamingReporterBase( std::move(_config) ) {
std::cout << "X28 - TestReporter constructed\n";
}
diff --git a/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp
index 9721775d..d3af7dc7 100644
--- a/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp
+++ b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp
@@ -25,8 +25,8 @@
class TestReporter : public Catch::StreamingReporterBase {
public:
- TestReporter( Catch::ReporterConfig const& _config ):
- StreamingReporterBase( _config ) {
+ TestReporter( Catch::ReporterConfig&& _config ):
+ StreamingReporterBase( std::move(_config) ) {
std::cout << "X29 - TestReporter constructed\n";
}