mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Refactored console reporter include logic to match Xml Reporter’s
This commit is contained in:
parent
9bee606dd6
commit
f9db24a824
@ -40,18 +40,15 @@ namespace Catch {
|
|||||||
virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE {
|
virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE {
|
||||||
AssertionResult const& result = _assertionStats.assertionResult;
|
AssertionResult const& result = _assertionStats.assertionResult;
|
||||||
|
|
||||||
bool printInfoMessages = true;
|
bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
|
||||||
|
|
||||||
// Drop out if result was successful and we're not printing those
|
// Drop out if result was successful but we're not printing them.
|
||||||
if( !m_config->includeSuccessfulResults() && result.isOk() ) {
|
if( !includeResults && result.getResultType() != ResultWas::Warning )
|
||||||
if( result.getResultType() != ResultWas::Warning )
|
|
||||||
return false;
|
return false;
|
||||||
printInfoMessages = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
lazyPrint();
|
lazyPrint();
|
||||||
|
|
||||||
AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
|
AssertionPrinter printer( stream, _assertionStats, includeResults );
|
||||||
printer.print();
|
printer.print();
|
||||||
stream << std::endl;
|
stream << std::endl;
|
||||||
return true;
|
return true;
|
||||||
|
@ -95,7 +95,7 @@ namespace Catch {
|
|||||||
|
|
||||||
AssertionResult const& result = assertionStats.assertionResult;
|
AssertionResult const& result = assertionStats.assertionResult;
|
||||||
|
|
||||||
bool includeResults = m_config->includeSuccessfulResults() || result.isOk();
|
bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
|
||||||
|
|
||||||
if( includeResults ) {
|
if( includeResults ) {
|
||||||
// Print any info messages in <Info> tags.
|
// Print any info messages in <Info> tags.
|
||||||
|
Loading…
Reference in New Issue
Block a user