mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-30 01:03:30 +01:00
A load more C++11 tweaks - mostly moving initialisations from constructors to inline
This commit is contained in:
parent
cc8206f4c3
commit
e749724a11
@ -27,12 +27,7 @@ namespace Detail {
|
|||||||
m_value( value )
|
m_value( value )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Approx( Approx const& other )
|
Approx( Approx const& other ) = default;
|
||||||
: m_epsilon( other.m_epsilon ),
|
|
||||||
m_margin( other.m_margin ),
|
|
||||||
m_scale( other.m_scale ),
|
|
||||||
m_value( other.m_value )
|
|
||||||
{}
|
|
||||||
|
|
||||||
static Approx custom() {
|
static Approx custom() {
|
||||||
return Approx( 0 );
|
return Approx( 0 );
|
||||||
|
@ -53,11 +53,6 @@ namespace Catch {
|
|||||||
|
|
||||||
struct AssertionResultData
|
struct AssertionResultData
|
||||||
{
|
{
|
||||||
AssertionResultData() : decomposedExpression( nullptr )
|
|
||||||
, resultType( ResultWas::Unknown )
|
|
||||||
, negated( false )
|
|
||||||
, parenthesized( false ) {}
|
|
||||||
|
|
||||||
void negate( bool parenthesize ) {
|
void negate( bool parenthesize ) {
|
||||||
negated = !negated;
|
negated = !negated;
|
||||||
parenthesized = parenthesize;
|
parenthesized = parenthesize;
|
||||||
@ -82,12 +77,12 @@ namespace Catch {
|
|||||||
return reconstructedExpression;
|
return reconstructedExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutable DecomposedExpression const* decomposedExpression;
|
mutable DecomposedExpression const* decomposedExpression = nullptr;
|
||||||
mutable std::string reconstructedExpression;
|
mutable std::string reconstructedExpression;
|
||||||
std::string message;
|
std::string message;
|
||||||
ResultWas::OfType resultType;
|
ResultWas::OfType resultType = ResultWas::Unknown;
|
||||||
bool negated;
|
bool negated = false;
|
||||||
bool parenthesized;
|
bool parenthesized = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AssertionResult {
|
class AssertionResult {
|
||||||
|
@ -25,47 +25,26 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct ConfigData {
|
struct ConfigData {
|
||||||
|
bool listTests = false;
|
||||||
|
bool listTags = false;
|
||||||
|
bool listReporters = false;
|
||||||
|
bool listTestNamesOnly = false;
|
||||||
|
|
||||||
ConfigData()
|
bool showSuccessfulTests = false;
|
||||||
: listTests( false ),
|
bool shouldDebugBreak = false;
|
||||||
listTags( false ),
|
bool noThrow = false;
|
||||||
listReporters( false ),
|
bool showHelp = false;
|
||||||
listTestNamesOnly( false ),
|
bool showInvisibles = false;
|
||||||
showSuccessfulTests( false ),
|
bool filenamesAsTags = false;
|
||||||
shouldDebugBreak( false ),
|
|
||||||
noThrow( false ),
|
|
||||||
showHelp( false ),
|
|
||||||
showInvisibles( false ),
|
|
||||||
filenamesAsTags( false ),
|
|
||||||
abortAfter( -1 ),
|
|
||||||
rngSeed( 0 ),
|
|
||||||
verbosity( Verbosity::Normal ),
|
|
||||||
warnings( WarnAbout::Nothing ),
|
|
||||||
showDurations( ShowDurations::DefaultForReporter ),
|
|
||||||
runOrder( RunTests::InDeclarationOrder ),
|
|
||||||
useColour( UseColour::Auto )
|
|
||||||
{}
|
|
||||||
|
|
||||||
bool listTests;
|
int abortAfter = -1;
|
||||||
bool listTags;
|
unsigned int rngSeed = 0;
|
||||||
bool listReporters;
|
|
||||||
bool listTestNamesOnly;
|
|
||||||
|
|
||||||
bool showSuccessfulTests;
|
Verbosity::Level verbosity = Verbosity::Normal;
|
||||||
bool shouldDebugBreak;
|
WarnAbout::What warnings = WarnAbout::Nothing;
|
||||||
bool noThrow;
|
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
|
||||||
bool showHelp;
|
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
|
||||||
bool showInvisibles;
|
UseColour::YesOrNo useColour = UseColour::Auto;
|
||||||
bool filenamesAsTags;
|
|
||||||
|
|
||||||
int abortAfter;
|
|
||||||
unsigned int rngSeed;
|
|
||||||
|
|
||||||
Verbosity::Level verbosity;
|
|
||||||
WarnAbout::What warnings;
|
|
||||||
ShowDurations::OrNot showDurations;
|
|
||||||
RunTests::InWhatOrder runOrder;
|
|
||||||
UseColour::YesOrNo useColour;
|
|
||||||
|
|
||||||
std::string outputFilename;
|
std::string outputFilename;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
@ -16,11 +16,7 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
class Context : public IMutableContext {
|
class Context : public IMutableContext, NonCopyable {
|
||||||
|
|
||||||
Context() : m_config( nullptr ), m_runner( nullptr ), m_resultCapture( nullptr ) {}
|
|
||||||
Context( Context const& );
|
|
||||||
void operator=( Context const& );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Context() {
|
virtual ~Context() {
|
||||||
@ -84,8 +80,8 @@ namespace Catch {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ptr<IConfig const> m_config;
|
Ptr<IConfig const> m_config;
|
||||||
IRunner* m_runner;
|
IRunner* m_runner = nullptr;
|
||||||
IResultCapture* m_resultCapture;
|
IResultCapture* m_resultCapture = nullptr;
|
||||||
std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
|
std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class MatchExpression;
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
class ExpressionLhs : public DecomposedExpression {
|
class ExpressionLhs : public DecomposedExpression {
|
||||||
public:
|
public:
|
||||||
ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ), m_truthy(false) {}
|
ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {}
|
||||||
|
|
||||||
ExpressionLhs& operator = ( const ExpressionLhs& );
|
ExpressionLhs& operator = ( const ExpressionLhs& );
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
ResultBuilder& m_rb;
|
ResultBuilder& m_rb;
|
||||||
T m_lhs;
|
T m_lhs;
|
||||||
bool m_truthy;
|
bool m_truthy = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LhsT, Internal::Operator Op, typename RhsT>
|
template<typename LhsT, Internal::Operator Op, typename RhsT>
|
||||||
|
@ -71,7 +71,6 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct TagInfo {
|
struct TagInfo {
|
||||||
TagInfo() : count ( 0 ) {}
|
|
||||||
void add( std::string const& spelling ) {
|
void add( std::string const& spelling ) {
|
||||||
++count;
|
++count;
|
||||||
spellings.insert( spelling );
|
spellings.insert( spelling );
|
||||||
@ -83,7 +82,7 @@ namespace Catch {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
std::set<std::string> spellings;
|
std::set<std::string> spellings;
|
||||||
std::size_t count;
|
std::size_t count = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::size_t listTags( Config const& config ) {
|
inline std::size_t listTags( Config const& config ) {
|
||||||
|
@ -20,7 +20,7 @@ namespace Catch {
|
|||||||
template<typename T> class ExpressionLhs;
|
template<typename T> class ExpressionLhs;
|
||||||
|
|
||||||
struct CopyableStream {
|
struct CopyableStream {
|
||||||
CopyableStream() {}
|
CopyableStream() = default;
|
||||||
CopyableStream( CopyableStream const& other ) {
|
CopyableStream( CopyableStream const& other ) {
|
||||||
oss << other.oss.str();
|
oss << other.oss.str();
|
||||||
}
|
}
|
||||||
@ -82,9 +82,9 @@ namespace Catch {
|
|||||||
AssertionResultData m_data;
|
AssertionResultData m_data;
|
||||||
CopyableStream m_stream;
|
CopyableStream m_stream;
|
||||||
|
|
||||||
bool m_shouldDebugBreak;
|
bool m_shouldDebugBreak = false;
|
||||||
bool m_shouldThrow;
|
bool m_shouldThrow = false;
|
||||||
bool m_guardException;
|
bool m_guardException = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
@ -28,10 +28,7 @@ namespace Catch {
|
|||||||
char const* capturedExpression,
|
char const* capturedExpression,
|
||||||
ResultDisposition::Flags resultDisposition,
|
ResultDisposition::Flags resultDisposition,
|
||||||
char const* secondArg )
|
char const* secondArg )
|
||||||
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition )
|
||||||
m_shouldDebugBreak( false ),
|
|
||||||
m_shouldThrow( false ),
|
|
||||||
m_guardException( false )
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ResultBuilder::~ResultBuilder() {
|
ResultBuilder::~ResultBuilder() {
|
||||||
|
@ -62,10 +62,8 @@ namespace Catch {
|
|||||||
explicit RunContext( Ptr<IConfig const> const& _config, Ptr<IStreamingReporter> const& reporter )
|
explicit RunContext( Ptr<IConfig const> const& _config, Ptr<IStreamingReporter> const& reporter )
|
||||||
: m_runInfo( _config->name() ),
|
: m_runInfo( _config->name() ),
|
||||||
m_context( getCurrentMutableContext() ),
|
m_context( getCurrentMutableContext() ),
|
||||||
m_activeTestCase( nullptr ),
|
|
||||||
m_config( _config ),
|
m_config( _config ),
|
||||||
m_reporter( reporter ),
|
m_reporter( reporter )
|
||||||
m_shouldReportUnexpected ( true )
|
|
||||||
{
|
{
|
||||||
m_context.setRunner( this );
|
m_context.setRunner( this );
|
||||||
m_context.setConfig( m_config );
|
m_context.setConfig( m_config );
|
||||||
@ -350,7 +348,7 @@ namespace Catch {
|
|||||||
|
|
||||||
TestRunInfo m_runInfo;
|
TestRunInfo m_runInfo;
|
||||||
IMutableContext& m_context;
|
IMutableContext& m_context;
|
||||||
TestCase const* m_activeTestCase;
|
TestCase const* m_activeTestCase = nullptr;
|
||||||
ITracker* m_testCaseTracker;
|
ITracker* m_testCaseTracker;
|
||||||
ITracker* m_currentSectionTracker;
|
ITracker* m_currentSectionTracker;
|
||||||
AssertionResult m_lastResult;
|
AssertionResult m_lastResult;
|
||||||
@ -363,7 +361,7 @@ namespace Catch {
|
|||||||
std::vector<SectionEndInfo> m_unfinishedSections;
|
std::vector<SectionEndInfo> m_unfinishedSections;
|
||||||
std::vector<ITracker*> m_activeSections;
|
std::vector<ITracker*> m_activeSections;
|
||||||
TrackerContext m_trackerContext;
|
TrackerContext m_trackerContext;
|
||||||
bool m_shouldReportUnexpected;
|
bool m_shouldReportUnexpected = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
IResultCapture& getResultCapture() {
|
IResultCapture& getResultCapture() {
|
||||||
|
@ -22,7 +22,7 @@ namespace Catch {
|
|||||||
~Section();
|
~Section();
|
||||||
|
|
||||||
// This indicates whether the section should be executed or not
|
// This indicates whether the section should be executed or not
|
||||||
operator bool() const;
|
explicit operator bool() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SectionInfo m_info;
|
SectionInfo m_info;
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
# pragma clang diagnostic ignored "-Wunused-variable"
|
# pragma clang diagnostic ignored "-Wunused-variable"
|
||||||
# pragma clang diagnostic push
|
# pragma clang diagnostic push
|
||||||
# pragma clang diagnostic ignored "-Wpadded"
|
# pragma clang diagnostic ignored "-Wpadded"
|
||||||
# pragma clang diagnostic ignored "-Wc++98-compat"
|
|
||||||
# pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
|
||||||
# pragma clang diagnostic ignored "-Wswitch-enum"
|
# pragma clang diagnostic ignored "-Wswitch-enum"
|
||||||
# pragma clang diagnostic ignored "-Wcovered-switch-default"
|
# pragma clang diagnostic ignored "-Wcovered-switch-default"
|
||||||
# endif
|
# endif
|
||||||
|
@ -91,10 +91,6 @@ namespace Catch {
|
|||||||
|
|
||||||
class TestRegistry : public ITestCaseRegistry {
|
class TestRegistry : public ITestCaseRegistry {
|
||||||
public:
|
public:
|
||||||
TestRegistry()
|
|
||||||
: m_currentSortOrder( RunTests::InDeclarationOrder ),
|
|
||||||
m_unnamedCount( 0 )
|
|
||||||
{}
|
|
||||||
virtual ~TestRegistry();
|
virtual ~TestRegistry();
|
||||||
|
|
||||||
virtual void registerTest( TestCase const& testCase ) {
|
virtual void registerTest( TestCase const& testCase ) {
|
||||||
@ -123,9 +119,9 @@ namespace Catch {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<TestCase> m_functions;
|
std::vector<TestCase> m_functions;
|
||||||
mutable RunTests::InWhatOrder m_currentSortOrder;
|
mutable RunTests::InWhatOrder m_currentSortOrder = RunTests::InDeclarationOrder;
|
||||||
mutable std::vector<TestCase> m_sortedFunctions;
|
mutable std::vector<TestCase> m_sortedFunctions;
|
||||||
size_t m_unnamedCount;
|
size_t m_unnamedCount = 0;
|
||||||
std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
|
std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ namespace TestCaseTracking {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ptr<ITracker> m_rootTracker;
|
Ptr<ITracker> m_rootTracker;
|
||||||
ITracker* m_currentTracker;
|
ITracker* m_currentTracker = nullptr;
|
||||||
RunState m_runState;
|
RunState m_runState = NotStarted;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -79,12 +79,6 @@ namespace TestCaseTracking {
|
|||||||
return s_instance;
|
return s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackerContext()
|
|
||||||
: m_currentTracker( nullptr ),
|
|
||||||
m_runState( NotStarted )
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
ITracker& startRun();
|
ITracker& startRun();
|
||||||
|
|
||||||
void endRun() {
|
void endRun() {
|
||||||
@ -137,13 +131,12 @@ namespace TestCaseTracking {
|
|||||||
TrackerContext& m_ctx;
|
TrackerContext& m_ctx;
|
||||||
ITracker* m_parent;
|
ITracker* m_parent;
|
||||||
Children m_children;
|
Children m_children;
|
||||||
CycleState m_runState;
|
CycleState m_runState = NotStarted;
|
||||||
public:
|
public:
|
||||||
TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
|
TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
|
||||||
: m_nameAndLocation( nameAndLocation ),
|
: m_nameAndLocation( nameAndLocation ),
|
||||||
m_ctx( ctx ),
|
m_ctx( ctx ),
|
||||||
m_parent( parent ),
|
m_parent( parent )
|
||||||
m_runState( NotStarted )
|
|
||||||
{}
|
{}
|
||||||
virtual ~TrackerBase();
|
virtual ~TrackerBase();
|
||||||
|
|
||||||
@ -302,12 +295,11 @@ namespace TestCaseTracking {
|
|||||||
|
|
||||||
class IndexTracker : public TrackerBase {
|
class IndexTracker : public TrackerBase {
|
||||||
int m_size;
|
int m_size;
|
||||||
int m_index;
|
int m_index = -1;
|
||||||
public:
|
public:
|
||||||
IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size )
|
IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size )
|
||||||
: TrackerBase( nameAndLocation, ctx, parent ),
|
: TrackerBase( nameAndLocation, ctx, parent ),
|
||||||
m_size( size ),
|
m_size( size )
|
||||||
m_index( -1 )
|
|
||||||
{}
|
{}
|
||||||
virtual ~IndexTracker();
|
virtual ~IndexTracker();
|
||||||
|
|
||||||
|
@ -13,14 +13,13 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
class Timer {
|
class Timer {
|
||||||
public:
|
public:
|
||||||
Timer() : m_microSeconds( 0 ) {}
|
|
||||||
void start();
|
void start();
|
||||||
unsigned int getElapsedMicroseconds() const;
|
unsigned int getElapsedMicroseconds() const;
|
||||||
unsigned int getElapsedMilliseconds() const;
|
unsigned int getElapsedMilliseconds() const;
|
||||||
double getElapsedSeconds() const;
|
double getElapsedSeconds() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t m_microSeconds;
|
uint64_t m_microSeconds = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct Counts {
|
struct Counts {
|
||||||
Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {}
|
|
||||||
|
|
||||||
Counts operator - ( Counts const& other ) const {
|
Counts operator - ( Counts const& other ) const {
|
||||||
Counts diff;
|
Counts diff;
|
||||||
diff.passed = passed - other.passed;
|
diff.passed = passed - other.passed;
|
||||||
@ -39,9 +37,9 @@ namespace Catch {
|
|||||||
return failed == 0;
|
return failed == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t passed;
|
std::size_t passed = 0;
|
||||||
std::size_t failed;
|
std::size_t failed = 0;
|
||||||
std::size_t failedButOk;
|
std::size_t failedButOk = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Totals {
|
struct Totals {
|
||||||
|
@ -27,7 +27,6 @@ namespace Catch
|
|||||||
|
|
||||||
WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity )
|
WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity )
|
||||||
: m_caseSensitivity( caseSensitivity ),
|
: m_caseSensitivity( caseSensitivity ),
|
||||||
m_wildcard( NoWildcard ),
|
|
||||||
m_pattern( adjustCase( pattern ) )
|
m_pattern( adjustCase( pattern ) )
|
||||||
{
|
{
|
||||||
if( startsWith( m_pattern, '*' ) ) {
|
if( startsWith( m_pattern, '*' ) ) {
|
||||||
@ -66,7 +65,7 @@ namespace Catch
|
|||||||
return m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str;
|
return m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str;
|
||||||
}
|
}
|
||||||
CaseSensitive::Choice m_caseSensitivity;
|
CaseSensitive::Choice m_caseSensitivity;
|
||||||
WildcardPosition m_wildcard;
|
WildcardPosition m_wildcard = NoWildcard;
|
||||||
std::string m_pattern;
|
std::string m_pattern;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -112,18 +112,7 @@ namespace Catch {
|
|||||||
mutable XmlWriter* m_writer;
|
mutable XmlWriter* m_writer;
|
||||||
};
|
};
|
||||||
|
|
||||||
XmlWriter()
|
XmlWriter( std::ostream& os = Catch::cout() ) : m_os( os )
|
||||||
: m_tagIsOpen( false ),
|
|
||||||
m_needsNewline( false ),
|
|
||||||
m_os( Catch::cout() )
|
|
||||||
{
|
|
||||||
writeDeclaration();
|
|
||||||
}
|
|
||||||
|
|
||||||
XmlWriter( std::ostream& os )
|
|
||||||
: m_tagIsOpen( false ),
|
|
||||||
m_needsNewline( false ),
|
|
||||||
m_os( os )
|
|
||||||
{
|
{
|
||||||
writeDeclaration();
|
writeDeclaration();
|
||||||
}
|
}
|
||||||
@ -233,8 +222,8 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool m_tagIsOpen;
|
bool m_tagIsOpen = false;
|
||||||
bool m_needsNewline;
|
bool m_needsNewline = false;
|
||||||
std::vector<std::string> m_tags;
|
std::vector<std::string> m_tags;
|
||||||
std::string m_indent;
|
std::string m_indent;
|
||||||
std::ostream& m_os;
|
std::ostream& m_os;
|
||||||
|
@ -17,9 +17,7 @@ namespace Catch {
|
|||||||
|
|
||||||
struct CompactReporter : StreamingReporterBase {
|
struct CompactReporter : StreamingReporterBase {
|
||||||
|
|
||||||
CompactReporter( ReporterConfig const& _config )
|
using StreamingReporterBase::StreamingReporterBase;
|
||||||
: StreamingReporterBase( _config )
|
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~CompactReporter();
|
virtual ~CompactReporter();
|
||||||
|
|
||||||
|
@ -20,10 +20,7 @@ namespace Catch {
|
|||||||
|
|
||||||
|
|
||||||
struct ConsoleReporter : StreamingReporterBase {
|
struct ConsoleReporter : StreamingReporterBase {
|
||||||
ConsoleReporter( ReporterConfig const& _config )
|
using StreamingReporterBase::StreamingReporterBase;
|
||||||
: StreamingReporterBase( _config ),
|
|
||||||
m_headerPrinted( false )
|
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~ConsoleReporter() override;
|
virtual ~ConsoleReporter() override;
|
||||||
static std::string getDescription() {
|
static std::string getDescription() {
|
||||||
@ -435,7 +432,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_headerPrinted;
|
bool m_headerPrinted = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter )
|
INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter )
|
||||||
|
@ -51,8 +51,7 @@ namespace Catch {
|
|||||||
public:
|
public:
|
||||||
JunitReporter( ReporterConfig const& _config )
|
JunitReporter( ReporterConfig const& _config )
|
||||||
: CumulativeReporterBase( _config ),
|
: CumulativeReporterBase( _config ),
|
||||||
xml( _config.stream() ),
|
xml( _config.stream() )
|
||||||
m_okToFail( false )
|
|
||||||
{
|
{
|
||||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||||
}
|
}
|
||||||
@ -233,7 +232,7 @@ namespace Catch {
|
|||||||
std::ostringstream stdOutForSuite;
|
std::ostringstream stdOutForSuite;
|
||||||
std::ostringstream stdErrForSuite;
|
std::ostringstream stdErrForSuite;
|
||||||
unsigned int unexpectedExceptions;
|
unsigned int unexpectedExceptions;
|
||||||
bool m_okToFail;
|
bool m_okToFail = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
|
INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
|
||||||
|
@ -21,10 +21,7 @@ namespace Catch {
|
|||||||
|
|
||||||
struct TAPReporter : StreamingReporterBase {
|
struct TAPReporter : StreamingReporterBase {
|
||||||
|
|
||||||
TAPReporter( ReporterConfig const& _config )
|
using StreamingReporterBase::StreamingReporterBase;
|
||||||
: StreamingReporterBase( _config ),
|
|
||||||
counter(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~TAPReporter();
|
virtual ~TAPReporter();
|
||||||
|
|
||||||
@ -62,7 +59,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t counter;
|
size_t counter = 0;
|
||||||
class AssertionPrinter {
|
class AssertionPrinter {
|
||||||
void operator= ( AssertionPrinter const& );
|
void operator= ( AssertionPrinter const& );
|
||||||
public:
|
public:
|
||||||
|
@ -25,8 +25,7 @@ namespace Catch {
|
|||||||
|
|
||||||
struct TeamCityReporter : StreamingReporterBase {
|
struct TeamCityReporter : StreamingReporterBase {
|
||||||
TeamCityReporter( ReporterConfig const& _config )
|
TeamCityReporter( ReporterConfig const& _config )
|
||||||
: StreamingReporterBase( _config ),
|
: StreamingReporterBase( _config )
|
||||||
m_headerPrintedForThisSection( false )
|
|
||||||
{
|
{
|
||||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||||
}
|
}
|
||||||
@ -198,7 +197,7 @@ namespace Catch {
|
|||||||
.setInitialIndent( indent ) ) << "\n";
|
.setInitialIndent( indent ) ) << "\n";
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
bool m_headerPrintedForThisSection;
|
bool m_headerPrintedForThisSection = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CATCH_IMPL
|
#ifdef CATCH_IMPL
|
||||||
|
@ -20,8 +20,7 @@ namespace Catch {
|
|||||||
public:
|
public:
|
||||||
XmlReporter( ReporterConfig const& _config )
|
XmlReporter( ReporterConfig const& _config )
|
||||||
: StreamingReporterBase( _config ),
|
: StreamingReporterBase( _config ),
|
||||||
m_xml(_config.stream()),
|
m_xml(_config.stream())
|
||||||
m_sectionDepth( 0 )
|
|
||||||
{
|
{
|
||||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||||
}
|
}
|
||||||
@ -219,7 +218,7 @@ namespace Catch {
|
|||||||
private:
|
private:
|
||||||
Timer m_testCaseTimer;
|
Timer m_testCaseTimer;
|
||||||
XmlWriter m_xml;
|
XmlWriter m_xml;
|
||||||
int m_sectionDepth;
|
int m_sectionDepth = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
|
INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
|
||||||
|
Loading…
Reference in New Issue
Block a user