Do uncaught_exception checking before calling sectionEnded

- split the uncaught handling (adding to unfinishedSections) into separate method
This commit is contained in:
Phil Nash
2015-09-26 18:12:21 -07:00
parent d234ed1a67
commit 166ca2e819
4 changed files with 36 additions and 29 deletions

View File

@@ -32,8 +32,13 @@ namespace Catch {
}
Section::~Section() {
if( m_sectionIncluded )
getResultCapture().sectionEnded( m_info, m_assertions, m_timer.getElapsedSeconds() );
if( m_sectionIncluded ) {
SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
if( std::uncaught_exception() )
getResultCapture().sectionEndedEarly( endInfo );
else
getResultCapture().sectionEnded( endInfo );
}
}
// This indicates whether the section should be executed or not