mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Removed deprecated message code
This commit is contained in:
parent
207b27b3c5
commit
ad654867f1
@ -16,7 +16,6 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
class TestCase;
|
class TestCase;
|
||||||
class ScopedInfo;
|
|
||||||
class ExpressionResultBuilder;
|
class ExpressionResultBuilder;
|
||||||
class AssertionResult;
|
class AssertionResult;
|
||||||
struct AssertionInfo;
|
struct AssertionInfo;
|
||||||
@ -32,8 +31,6 @@ namespace Catch {
|
|||||||
virtual bool sectionStarted( SectionInfo const& sectionInfo,
|
virtual bool sectionStarted( SectionInfo const& sectionInfo,
|
||||||
Counts& assertions ) = 0;
|
Counts& assertions ) = 0;
|
||||||
virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0;
|
virtual void sectionEnded( SectionInfo const& name, Counts const& assertions ) = 0;
|
||||||
virtual void pushScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated
|
|
||||||
virtual void popScopedInfo( ScopedInfo* scopedInfo ) = 0; // !TBD Deprecated
|
|
||||||
virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) = 0;
|
virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) = 0;
|
||||||
virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) = 0;
|
virtual void popScopedMessage( ScopedMessageBuilder const& _builder ) = 0;
|
||||||
|
|
||||||
|
@ -170,32 +170,11 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
else if( !result.isOk() ) {
|
else if( !result.isOk() ) {
|
||||||
m_totals.assertions.failed++;
|
m_totals.assertions.failed++;
|
||||||
|
|
||||||
// {
|
|
||||||
// std::vector<ScopedInfo*>::const_iterator it = m_scopedInfos.begin();
|
|
||||||
// std::vector<ScopedInfo*>::const_iterator itEnd = m_scopedInfos.end();
|
|
||||||
// for(; it != itEnd; ++it )
|
|
||||||
// m_reporter->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) );
|
|
||||||
// }
|
|
||||||
// {
|
|
||||||
// std::vector<AssertionResult>::const_iterator it = m_assertionResults.begin();
|
|
||||||
// std::vector<AssertionResult>::const_iterator itEnd = m_assertionResults.end();
|
|
||||||
// for(; it != itEnd; ++it )
|
|
||||||
// m_reporter->assertionEnded( AssertionStats( *it, m_totals ) );
|
|
||||||
// }
|
|
||||||
// m_assertionResults.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( result.getResultType() == ResultWas::Info ) {
|
m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) );
|
||||||
// !TBD: deprecated? - what does this even do?
|
|
||||||
m_assertionResults.push_back( result );
|
|
||||||
m_totals.assertions.info++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset AssertionInfo
|
// Reset working state
|
||||||
m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
|
m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
|
||||||
m_messages.clear();
|
m_messages.clear();
|
||||||
}
|
}
|
||||||
@ -238,14 +217,6 @@ namespace Catch {
|
|||||||
m_messages.clear();
|
m_messages.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void pushScopedInfo( ScopedInfo* scopedInfo ) {
|
|
||||||
m_scopedInfos.push_back( scopedInfo );
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void popScopedInfo( ScopedInfo* scopedInfo ) {
|
|
||||||
if( m_scopedInfos.back() == scopedInfo )
|
|
||||||
m_scopedInfos.pop_back();
|
|
||||||
}
|
|
||||||
virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) {
|
virtual void pushScopedMessage( ScopedMessageBuilder const& _builder ) {
|
||||||
m_messages.push_back( _builder.build() );
|
m_messages.push_back( _builder.build() );
|
||||||
}
|
}
|
||||||
@ -314,7 +285,6 @@ namespace Catch {
|
|||||||
exResult << translateActiveException();
|
exResult << translateActiveException();
|
||||||
actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) );
|
actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) );
|
||||||
}
|
}
|
||||||
m_assertionResults.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -326,8 +296,6 @@ namespace Catch {
|
|||||||
const Config& m_config;
|
const Config& m_config;
|
||||||
Totals m_totals;
|
Totals m_totals;
|
||||||
Ptr<IStreamingReporter> m_reporter;
|
Ptr<IStreamingReporter> m_reporter;
|
||||||
std::vector<ScopedInfo*> m_scopedInfos; // !TBD: deprecated
|
|
||||||
std::vector<AssertionResult> m_assertionResults; // !TBD: deprecated
|
|
||||||
std::vector<MessageInfo> m_messages;
|
std::vector<MessageInfo> m_messages;
|
||||||
IRunner* m_prevRunner;
|
IRunner* m_prevRunner;
|
||||||
IResultCapture* m_prevResultCapture;
|
IResultCapture* m_prevResultCapture;
|
||||||
|
@ -13,19 +13,17 @@
|
|||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct Counts {
|
struct Counts {
|
||||||
Counts() : passed( 0 ), failed( 0 ), info( 0 ) {}
|
Counts() : passed( 0 ), failed( 0 ) {}
|
||||||
|
|
||||||
Counts operator - ( const Counts& other ) const {
|
Counts operator - ( const Counts& other ) const {
|
||||||
Counts diff;
|
Counts diff;
|
||||||
diff.passed = passed - other.passed;
|
diff.passed = passed - other.passed;
|
||||||
diff.failed = failed - other.failed;
|
diff.failed = failed - other.failed;
|
||||||
diff.info = info - other.info;
|
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
Counts& operator += ( const Counts& other ) {
|
Counts& operator += ( const Counts& other ) {
|
||||||
passed += other.passed;
|
passed += other.passed;
|
||||||
failed += other.failed;
|
failed += other.failed;
|
||||||
info += other.info;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +33,6 @@ namespace Catch {
|
|||||||
|
|
||||||
std::size_t passed;
|
std::size_t passed;
|
||||||
std::size_t failed;
|
std::size_t failed;
|
||||||
std::size_t info;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Totals {
|
struct Totals {
|
||||||
|
Loading…
Reference in New Issue
Block a user