mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
INFOs only reset at assertion if consumed
This commit is contained in:
@@ -208,7 +208,7 @@ namespace Catch
|
||||
|
||||
virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
|
||||
|
||||
virtual void assertionEnded( AssertionStats const& assertionStats ) = 0;
|
||||
virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
|
||||
virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
|
||||
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
|
||||
virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
|
||||
|
@@ -25,7 +25,7 @@ namespace Catch
|
||||
virtual void testCaseStarting( TestCaseInfo const& testInfo );
|
||||
virtual void sectionStarting( SectionInfo const& sectionInfo );
|
||||
virtual void assertionStarting( AssertionInfo const& );
|
||||
virtual void assertionEnded( AssertionStats const& assertionStats );
|
||||
virtual bool assertionEnded( AssertionStats const& assertionStats );
|
||||
virtual void sectionEnded( SectionStats const& sectionStats );
|
||||
virtual void testCaseEnded( TestCaseStats const& testCaseStats );
|
||||
virtual void testGroupEnded( TestGroupStats const& testGroupStats );
|
||||
|
@@ -40,7 +40,7 @@ namespace Catch
|
||||
// Not on legacy interface
|
||||
}
|
||||
|
||||
void LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) {
|
||||
bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) {
|
||||
if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) {
|
||||
for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end();
|
||||
it != itEnd;
|
||||
@@ -55,6 +55,7 @@ namespace Catch
|
||||
}
|
||||
}
|
||||
m_legacyReporter->Result( assertionStats.assertionResult );
|
||||
return true;
|
||||
}
|
||||
void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) {
|
||||
if( sectionStats.missingAssertions )
|
||||
|
@@ -171,11 +171,11 @@ namespace Catch {
|
||||
m_totals.assertions.failed++;
|
||||
}
|
||||
|
||||
m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) );
|
||||
if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
|
||||
m_messages.clear();
|
||||
|
||||
// Reset working state
|
||||
m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
|
||||
m_messages.clear();
|
||||
}
|
||||
|
||||
virtual bool sectionStarted (
|
||||
|
@@ -39,18 +39,19 @@ namespace Catch {
|
||||
virtual void assertionStarting( AssertionInfo const& ) {
|
||||
}
|
||||
|
||||
virtual void assertionEnded( AssertionStats const& _assertionStats ) {
|
||||
virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
|
||||
AssertionResult const& result = _assertionStats.assertionResult;
|
||||
|
||||
// Drop out if result was successful and we're not printing those
|
||||
if( !m_config->includeSuccessfulResults() && result.isOk() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
lazyPrint();
|
||||
|
||||
AssertionPrinter printer( stream, _assertionStats );
|
||||
printer.print();
|
||||
stream << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void sectionStarting( SectionInfo const& _sectionInfo ) {
|
||||
|
Reference in New Issue
Block a user