Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Quick fix for nested sections - doesn't cover all cases yet

Commit
a8c31c725daffc6e3c4aac2a192f8872c152c448
Author
Phil Nash ·
Parents
ab30ab6b761d

Files · Download .tar.gz

Changes

 internal/catch_runner_impl.hpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/internal/catch_runner_impl.hpp b/internal/catch_runner_impl.hpp
index a435d69a..06ac82cc 100644
--- a/internal/catch_runner_impl.hpp
+++ b/internal/catch_runner_impl.hpp
@@ -107,9 +107,19 @@ namespace Catch
         {
             if( m_sectionsSeen.find( name ) != m_sectionsSeen.end() )
                 return false;
+            return true;
+        }
+
+        ///////////////////////////////////////////////////////////////////////        
+        void endSection
+        (
+            const std::string& name
+        )
+        {
             m_sectionsSeen.insert( name );
-            return m_sectionSeen = true;
+            m_sectionSeen = true;
         }
+
         ///////////////////////////////////////////////////////////////////////        
         const TestCaseInfo& getTestCaseInfo
         ()
@@ -382,6 +392,7 @@ namespace Catch
             std::size_t prevFailures 
         )
         {
+            m_runningTest.endSection( name );
             m_reporter->EndSection( name, m_successes - prevSuccesses, m_failures - prevFailures );
         }