--extra-info -> --list-extra-info, behaves like other --list-* flags

This commit is contained in:
Martin Hořeňovský 2017-06-22 19:27:17 +02:00
parent 616f7235ef
commit 07c6bfc3b9
3 changed files with 10 additions and 10 deletions

View File

@ -187,9 +187,9 @@ namespace Catch {
.describe( "list all/matching test cases names only" )
.bind( &ConfigData::listTestNamesOnly );
cli["--extra-info"]
.describe( "list more info" )
.bind( &ConfigData::extraInfo );
cli["--list-extra-info"]
.describe( "list all/matching test cases with more info" )
.bind( &ConfigData::listExtraInfo );
cli["--list-reporters"]
.describe( "list all reporters" )

View File

@ -31,7 +31,7 @@ namespace Catch {
listTags( false ),
listReporters( false ),
listTestNamesOnly( false ),
extraInfo( false ),
listExtraInfo( false ),
showSuccessfulTests( false ),
shouldDebugBreak( false ),
noThrow( false ),
@ -51,7 +51,7 @@ namespace Catch {
bool listTags;
bool listReporters;
bool listTestNamesOnly;
bool extraInfo;
bool listExtraInfo;
bool showSuccessfulTests;
bool shouldDebugBreak;
@ -111,7 +111,7 @@ namespace Catch {
bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
bool listTags() const { return m_data.listTags; }
bool listReporters() const { return m_data.listReporters; }
bool extraInfo() const { return m_data.extraInfo; }
bool listExtraInfo() const { return m_data.listExtraInfo; }
std::string getProcessName() const { return m_data.processName; }

View File

@ -47,10 +47,10 @@ namespace Catch {
Colour colourGuard( colour );
Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl;
if( config.extraInfo() ) {
if( config.listExtraInfo() ) {
Catch::cout() << " " << testCaseInfo.lineInfo << std::endl;
std::string description = testCaseInfo.description;
if( description == "" )
if( description.empty() )
description = "(NO DESCRIPTION)";
Catch::cout() << Text( description, descAttr ) << std::endl;
}
@ -80,7 +80,7 @@ namespace Catch {
Catch::cout() << '"' << testCaseInfo.name << '"';
else
Catch::cout() << testCaseInfo.name;
if ( config.extraInfo() )
if ( config.listExtraInfo() )
Catch::cout() << "\t@" << testCaseInfo.lineInfo;
Catch::cout() << std::endl;
}
@ -174,7 +174,7 @@ namespace Catch {
inline Option<std::size_t> list( Config const& config ) {
Option<std::size_t> listedCount;
if( config.listTests() )
if( config.listTests() || config.listExtraInfo() )
listedCount = listedCount.valueOr(0) + listTests( config );
if( config.listTestNamesOnly() )
listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );