Push LazyStat down into catch_reporter_streaming_base.hpp

This commit is contained in:
Martin Hořeňovský 2020-08-24 11:27:13 +02:00
parent 360b82620e
commit f9fdc96cbf
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 19 additions and 16 deletions

View File

@ -13,7 +13,6 @@
#include <catch2/catch_totals.hpp> #include <catch2/catch_totals.hpp>
#include <catch2/catch_assertion_result.hpp> #include <catch2/catch_assertion_result.hpp>
#include <catch2/internal/catch_message_info.hpp> #include <catch2/internal/catch_message_info.hpp>
#include <catch2/internal/catch_option.hpp>
#include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_unique_ptr.hpp> #include <catch2/internal/catch_unique_ptr.hpp>
@ -46,20 +45,6 @@ namespace Catch {
IConfig const* m_fullConfig; IConfig const* m_fullConfig;
}; };
template<typename T>
struct LazyStat : Option<T> {
LazyStat& operator=( T const& _value ) {
Option<T>::operator=( _value );
used = false;
return *this;
}
void reset() {
Option<T>::reset();
used = false;
}
bool used = false;
};
struct TestRunInfo { struct TestRunInfo {
TestRunInfo( std::string const& _name ); TestRunInfo( std::string const& _name );
std::string name; std::string name;

View File

@ -17,6 +17,7 @@
#include <catch2/internal/catch_test_case_tracker.hpp> #include <catch2/internal/catch_test_case_tracker.hpp>
#include <catch2/catch_assertion_info.hpp> #include <catch2/catch_assertion_info.hpp>
#include <catch2/catch_assertion_result.hpp> #include <catch2/catch_assertion_result.hpp>
#include <catch2/internal/catch_option.hpp>
#include <string> #include <string>

View File

@ -3,12 +3,29 @@
#include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <catch2/internal/catch_option.hpp>
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
#include <vector> #include <vector>
namespace Catch { namespace Catch {
template<typename T>
struct LazyStat : Option<T> {
LazyStat& operator=(T const& _value) {
Option<T>::operator=(_value);
used = false;
return *this;
}
void reset() {
Option<T>::reset();
used = false;
}
bool used = false;
};
struct StreamingReporterBase : IStreamingReporter { struct StreamingReporterBase : IStreamingReporter {
StreamingReporterBase( ReporterConfig const& _config ): StreamingReporterBase( ReporterConfig const& _config ):