#include #include #include #include namespace Catch { Section::Section( SectionInfo&& info ): m_info( std::move( info ) ), m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) { // Non-"included" sections will not use the timing information // anyway, so don't bother with the potential syscall. if (m_sectionIncluded) { m_timer.start(); } } Section::~Section() { if( m_sectionIncluded ) { SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() }; if( uncaught_exceptions() ) getResultCapture().sectionEndedEarly( endInfo ); else getResultCapture().sectionEnded( endInfo ); } } // This indicates whether the section should be executed or not Section::operator bool() const { return m_sectionIncluded; } } // end namespace Catch