From f5f130c0702e5731a887e8d58e9781571719ca25 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 25 Mar 2011 19:09:41 +0000 Subject: [PATCH] Refined multiline stdout --- catch_reporter_basic.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/catch_reporter_basic.hpp b/catch_reporter_basic.hpp index 4cf04200..18a63cdc 100644 --- a/catch_reporter_basic.hpp +++ b/catch_reporter_basic.hpp @@ -95,7 +95,7 @@ namespace Catch // Output the overall test results even if "Started Testing" was not emitted m_config.stream() << "[Testing completed. "; ReportCounts( succeeded, failed ); - m_config.stream() << "]" << std::endl; + m_config.stream() << "]\n" << std::endl; } /////////////////////////////////////////////////////////////////////////// @@ -238,7 +238,16 @@ namespace Catch if( !stdOut.empty() ) { StartSpansLazily(); - m_config.stream() << "[stdout: " << trim( stdOut ) << "]\n"; + std::string stdOutTrimmed = trim( stdOut ); + if( stdOutTrimmed.find_first_of( "\r\n" ) == std::string::npos ) + { + m_config.stream() << "[stdout: " << stdOutTrimmed << "]\n"; + } + else + { + m_config.stream() << "[stdout] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << stdOutTrimmed << "\n[end of stdout] <<<<<<<<<<<<<<<<<<<<<<<\n"; + } + } if( !stdErr.empty() )