diff --git a/include/internal/catch_section_info.cpp b/include/internal/catch_section_info.cpp deleted file mode 100644 index 89714e35..00000000 --- a/include/internal/catch_section_info.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 ) - : name( _name ), - lineInfo( _lineInfo ) - {} - -} // end namespace Catch diff --git a/include/internal/catch_section_info.h b/include/internal/catch_section_info.h index 7215c744..50a31aeb 100644 --- a/include/internal/catch_section_info.h +++ b/include/internal/catch_section_info.h @@ -17,17 +17,14 @@ namespace Catch { struct SectionInfo { - SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name ); - // The last argument is ignored, so that people can write // SECTION("ShortName", "Proper description that is long") and // still use the `-c` flag comfortably. - SectionInfo - ( SourceLineInfo const& _lineInfo, - std::string const& _name, - const char* const ) : SectionInfo( _lineInfo, _name ) {} + SectionInfo( SourceLineInfo const& _lineInfo, std::string _name, + const char* const = nullptr ): + name(std::move(_name)), + lineInfo(_lineInfo) + {} std::string name; SourceLineInfo lineInfo; diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt index 30536ebf..f36de496 100644 --- a/projects/CMakeLists.txt +++ b/projects/CMakeLists.txt @@ -244,7 +244,6 @@ 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_session.cpp ${HEADER_DIR}/internal/catch_singletons.cpp ${HEADER_DIR}/internal/catch_startup_exception_registry.cpp diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 6853df4e..0b2436ce 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -15,6 +15,7 @@ Misc.tests.cpp:: passed: Compilation.tests.cpp:: passed: std::memcmp(uarr, "123", sizeof(uarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' Compilation.tests.cpp:: passed: std::memcmp(sarr, "456", sizeof(sarr)) == 0 for: 0 == 0 with 2 messages: 'uarr := "123"' and 'sarr := "456"' Compilation.tests.cpp:: passed: +Compilation.tests.cpp:: passed: Compilation.tests.cpp:: passed: h1 == h2 for: [1403 helper] == [1403 helper] Message.tests.cpp:: warning: ' This info message starts with a linebreak' with 1 message: ' diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index a6338bde..3ae07e23 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1380,6 +1380,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 304 | 230 passed | 70 failed | 4 failed as expected -assertions: 1653 | 1501 passed | 131 failed | 21 failed as expected +test cases: 305 | 231 passed | 70 failed | 4 failed as expected +assertions: 1654 | 1502 passed | 131 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index e8259948..42f94b55 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -139,6 +139,15 @@ Compilation.tests.cpp: Compilation.tests.cpp:: PASSED: +------------------------------------------------------------------------------- +#1319: Sections can have description (even if it is not saved + SectionName +------------------------------------------------------------------------------- +Compilation.tests.cpp: +............................................................................... + +Compilation.tests.cpp:: PASSED: + ------------------------------------------------------------------------------- #1403 ------------------------------------------------------------------------------- @@ -13207,6 +13216,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 304 | 214 passed | 86 failed | 4 failed as expected -assertions: 1670 | 1501 passed | 148 failed | 21 failed as expected +test cases: 305 | 215 passed | 86 failed | 4 failed as expected +assertions: 1671 | 1502 passed | 148 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt index 0c1ab7b7..72d87375 100644 --- a/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -139,6 +139,15 @@ Compilation.tests.cpp: Compilation.tests.cpp:: PASSED: +------------------------------------------------------------------------------- +#1319: Sections can have description (even if it is not saved + SectionName +------------------------------------------------------------------------------- +Compilation.tests.cpp: +............................................................................... + +Compilation.tests.cpp:: PASSED: + ------------------------------------------------------------------------------- #1403 ------------------------------------------------------------------------------- @@ -368,6 +377,6 @@ Condition.tests.cpp:: FAILED: CHECK( true != true ) =============================================================================== -test cases: 19 | 14 passed | 3 failed | 2 failed as expected -assertions: 42 | 35 passed | 4 failed | 3 failed as expected +test cases: 20 | 15 passed | 3 failed | 2 failed as expected +assertions: 43 | 36 passed | 4 failed | 3 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 424e073c..9a04960f 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -14,6 +14,7 @@ + diff --git a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt b/projects/SelfTest/Baselines/sonarqube.sw.approved.txt index 0bd44a18..fb91039a 100644 --- a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/projects/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -358,6 +358,7 @@ Class.tests.cpp: + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index d57f0b86..2ceb9fe9 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -150,6 +150,12 @@ + +
+ +
+ +
@@ -15790,7 +15796,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/UsageTests/Compilation.tests.cpp b/projects/SelfTest/UsageTests/Compilation.tests.cpp index 11d136a4..aaba69c4 100644 --- a/projects/SelfTest/UsageTests/Compilation.tests.cpp +++ b/projects/SelfTest/UsageTests/Compilation.tests.cpp @@ -218,6 +218,12 @@ namespace { namespace CompilationTests { REQUIRE( y.v == 0 ); REQUIRE( 0 == y.v ); } + + TEST_CASE("#1319: Sections can have description (even if it is not saved", "[compilation]") { + SECTION("SectionName", "This is a long form section description") { + SUCCEED(); + } + } }} // namespace CompilationTests