Only use std::cout/ cert via Catch::cout/ cert - and make those conditional on CATCH_CONFIG_NOSTDOUT

This commit is contained in:
Phil Nash 2014-10-02 19:08:19 +01:00
parent 85b4e94192
commit 383d7c06a1
15 changed files with 109 additions and 83 deletions

View file

@ -81,12 +81,12 @@ namespace Catch {
public:
Config()
: m_os( std::cout.rdbuf() )
: m_os( Catch::cout().rdbuf() )
{}
Config( ConfigData const& data )
: m_data( data ),
m_os( std::cout.rdbuf() )
m_os( Catch::cout().rdbuf() )
{
if( !data.testsOrTags.empty() ) {
TestSpecParser parser( ITagAliasRegistry::get() );
@ -97,7 +97,7 @@ namespace Catch {
}
virtual ~Config() {
m_os.rdbuf( std::cout.rdbuf() );
m_os.rdbuf( Catch::cout().rdbuf() );
m_stream.release();
}
@ -119,7 +119,7 @@ namespace Catch {
bool shouldDebugBreak() const { return m_data.shouldDebugBreak; }
void setStreamBuf( std::streambuf* buf ) {
m_os.rdbuf( buf ? buf : std::cout.rdbuf() );
m_os.rdbuf( buf ? buf : Catch::cout().rdbuf() );
}
void useStream( std::string const& streamName ) {