diff options
| author | Phil Nash | 2015-09-26 18:12:21 -0700 |
|---|---|---|
| committer | Phil Nash | 2015-09-26 18:12:21 -0700 |
| commit | 166ca2e81901c2a12e10fcbf60908df286c2caed (patch) | |
| tree | f48019aa8f7e000794222404ae839cfe67ca9fea /include/internal/catch_section.hpp | |
| parent | d234ed1a67a41e2d14ddb1fbe839a4e5ab466311 (diff) | |
| download | catch3-166ca2e81901c2a12e10fcbf60908df286c2caed.tar.gz | |
Do uncaught_exception checking before calling sectionEnded
- split the uncaught handling (adding to unfinishedSections) into separate method
Diffstat (limited to 'include/internal/catch_section.hpp')
| -rw-r--r-- | include/internal/catch_section.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index ec4c1518..de65c4cd 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -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 |