From 783965991ad5b5d98bea4ff7154de594143782bd Mon Sep 17 00:00:00 2001 From: Baruch Burstein Date: Wed, 20 May 2015 22:59:33 +0300 Subject: [PATCH] Report full path of test run --- include/reporters/catch_reporter_bases.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index 865dc29e..37f54c18 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -18,7 +18,8 @@ namespace Catch { StreamingReporterBase( ReporterConfig const& _config ) : m_config( _config.fullConfig() ), - stream( _config.stream() ) + stream( _config.stream() ), + m_sectionCount( 0 ) {} virtual ~StreamingReporterBase(); @@ -37,10 +38,14 @@ namespace Catch { } virtual void sectionStarting( SectionInfo const& _sectionInfo ) { m_sectionStack.push_back( _sectionInfo ); + m_sectionCount++; } virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) { - m_sectionStack.pop_back(); + m_sectionCount--; + if(0 == m_sectionCount) { + m_sectionStack.clear(); + } } virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) { currentTestCaseInfo.reset(); @@ -67,6 +72,7 @@ namespace Catch { LazyStat currentTestCaseInfo; std::vector m_sectionStack; + std::size_t m_sectionCount; }; struct CumulativeReporterBase : SharedImpl {