MCPcopy Create free account
hub / github.com/catchorg/Catch2 / makeStream

Function makeStream

extras/catch_amalgamated.cpp:4659–4675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4657 ///////////////////////////////////////////////////////////////////////////
4658
4659 auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream> {
4660 if ( filename.empty() || filename == "-" ) {
4661 return Detail::make_unique<Detail::CoutStream>();
4662 }
4663 if( filename[0] == '%' ) {
4664 if ( filename == "%debug" ) {
4665 return Detail::make_unique<Detail::DebugOutStream>();
4666 } else if ( filename == "%stderr" ) {
4667 return Detail::make_unique<Detail::CerrStream>();
4668 } else if ( filename == "%stdout" ) {
4669 return Detail::make_unique<Detail::CoutStream>();
4670 } else {
4671 CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' );
4672 }
4673 }
4674 return Detail::make_unique<Detail::FileStream>( filename );
4675 }
4676
4677}
4678

Callers 4

prepareReportersFunction · 0.70
applyCommandLineMethod · 0.70
Stream.tests.cppFile · 0.50

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected