diff --git a/Test/MiscTests.cpp b/Test/MiscTests.cpp index ea004cc8..5ec21d31 100644 --- a/Test/MiscTests.cpp +++ b/Test/MiscTests.cpp @@ -22,10 +22,16 @@ TEST_CASE( "succeeding/Misc/Sections", "random SECTION tests" ) EXPECT( a != b ); EXPECT( b != a ); } - + SECTION( "s2", "not equal" ) { EXPECT_NOT( a == b); } - } + +TEST_CASE( "succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" ) +{ + std::cout << "Some information"; + + std::cerr << "An error"; +} \ No newline at end of file diff --git a/catch_reporter_basic.hpp b/catch_reporter_basic.hpp index 3026f70a..4a656fb0 100644 --- a/catch_reporter_basic.hpp +++ b/catch_reporter_basic.hpp @@ -153,8 +153,14 @@ namespace Catch } /////////////////////////////////////////////////////////////////////////// - virtual void EndTestCase( const TestCaseInfo& testInfo ) + virtual void EndTestCase( const TestCaseInfo& testInfo, const std::string& stdOut, const std::string& stdErr ) { + if( !stdOut.empty() ) + m_config.stream() << "[stdout: " << stdOut << "]\n"; + + if( !stdErr.empty() ) + m_config.stream() << "[stderr: " << stdErr << "]\n"; + m_config.stream() << "[Finished: " << testInfo.getName() << "]" << std::endl; } diff --git a/catch_reporter_xml.hpp b/catch_reporter_xml.hpp index c9953da2..f5e1cd18 100644 --- a/catch_reporter_xml.hpp +++ b/catch_reporter_xml.hpp @@ -91,7 +91,7 @@ namespace Catch } /////////////////////////////////////////////////////////////////////////// - virtual void EndTestCase( const Catch::TestCaseInfo& ) + virtual void EndTestCase( const Catch::TestCaseInfo&, const std::string& stdOut, const std::string& stdErr ) { m_config.stream() << "\t