Sections no longer save their description

Users can still write a description for their sections, but it will
no longer be saved as part of the `SectionInfo` struct. This ability
has also been added to the documentation.

Closes #1319
This commit is contained in:
Martin Hořeňovský
2019-11-03 22:50:53 +01:00
parent 2c6ace04a7
commit ae10e4ef72
3 changed files with 18 additions and 5 deletions

View File

@@ -9,6 +9,7 @@
#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
#include "catch_common.h"
#include "catch_stringref.h"
#include "catch_totals.h"
#include <string>
@@ -20,14 +21,15 @@ namespace Catch {
( SourceLineInfo const& _lineInfo,
std::string const& _name );
// Deprecated
// 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,
std::string const& ) : SectionInfo( _lineInfo, _name ) {}
const char* const ) : SectionInfo( _lineInfo, _name ) {}
std::string name;
std::string description; // !Deprecated: this will always be empty
SourceLineInfo lineInfo;
};