From f9db24a824b6b37eef4f9cde9798a04da59a63ef Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 3 Mar 2017 14:19:41 +0000 Subject: [PATCH] =?UTF-8?q?Refactored=20console=20reporter=20include=20log?= =?UTF-8?q?ic=20to=20match=20Xml=20Reporter=E2=80=99s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/reporters/catch_reporter_console.hpp | 13 +++++-------- include/reporters/catch_reporter_xml.hpp | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 224cbc9d..711d7fbe 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -40,18 +40,15 @@ namespace Catch { virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE { 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 - if( !m_config->includeSuccessfulResults() && result.isOk() ) { - if( result.getResultType() != ResultWas::Warning ) - return false; - printInfoMessages = false; - } + // Drop out if result was successful but we're not printing them. + if( !includeResults && result.getResultType() != ResultWas::Warning ) + return false; lazyPrint(); - AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); + AssertionPrinter printer( stream, _assertionStats, includeResults ); printer.print(); stream << std::endl; return true; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 412a5184..55c19564 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -95,7 +95,7 @@ namespace Catch { AssertionResult const& result = assertionStats.assertionResult; - bool includeResults = m_config->includeSuccessfulResults() || result.isOk(); + bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); if( includeResults ) { // Print any info messages in tags.