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

Move Section(End)Info bodies to proper .cpp file

Commit
d4e796c1382b850d020ff197bfc0ca82c70d05e2
Author
Martin Hořeňovský ·
Parents
0a3f899d6a63

Files · Download .tar.gz

Changes

 CMakeLists.txt                          |  1 +
 include/internal/catch_section.cpp      |  9 ---------
 include/internal/catch_section_info.cpp | 25 +++++++++++++++++++++++++
 include/internal/catch_section_info.h   |  4 +---
 4 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc5280b9..6af88fdd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,6 +217,7 @@ set(IMPL_SOURCES
         ${HEADER_DIR}/internal/catch_result_type.cpp
         ${HEADER_DIR}/internal/catch_run_context.cpp
         ${HEADER_DIR}/internal/catch_section.cpp
+        ${HEADER_DIR}/internal/catch_section_info.cpp
         ${HEADER_DIR}/internal/catch_startup_exception_registry.cpp
         ${HEADER_DIR}/internal/catch_string.cpp
         ${HEADER_DIR}/internal/catch_stringbuilder.cpp
diff --git a/include/internal/catch_section.cpp b/include/internal/catch_section.cpp
index 8c300415..4f192446 100644
--- a/include/internal/catch_section.cpp
+++ b/include/internal/catch_section.cpp
@@ -12,15 +12,6 @@
 
 namespace Catch {
 
-    SectionInfo::SectionInfo
-        (   SourceLineInfo const& _lineInfo,
-            std::string const& _name,
-            std::string const& _description )
-    :   name( _name ),
-        description( _description ),
-        lineInfo( _lineInfo )
-    {}
-
     Section::Section( SectionInfo const& info )
     :   m_info( info ),
         m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
diff --git a/include/internal/catch_section_info.cpp b/include/internal/catch_section_info.cpp
new file mode 100644
index 00000000..e2846b8a
--- /dev/null
+++ b/include/internal/catch_section_info.cpp
@@ -0,0 +1,25 @@
+/*
+ *  Created by Martin on 01/08/2017.
+ *
+ *  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#include "catch_section_info.h"
+
+namespace Catch {
+
+    SectionInfo::SectionInfo
+        (   SourceLineInfo const& _lineInfo,
+            std::string const& _name,
+            std::string const& _description )
+    :   name( _name ),
+        description( _description ),
+        lineInfo( _lineInfo )
+    {}
+
+    SectionEndInfo::SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds )
+    : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
+    {}
+
+} // end namespace Catch
diff --git a/include/internal/catch_section_info.h b/include/internal/catch_section_info.h
index c9f1c7f1..a10b2b77 100644
--- a/include/internal/catch_section_info.h
+++ b/include/internal/catch_section_info.h
@@ -27,9 +27,7 @@ namespace Catch {
     };
 
     struct SectionEndInfo {
-        SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds )
-        : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
-        {}
+        SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds );
 
         SectionInfo sectionInfo;
         Counts prevAssertions;