mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-24 13:39:24 +00:00
Refactored stream related stuff
- simpler, polymorphic hierarchy-based, approach - less bitty conditionals spread across the code - all resolved up-front so now config class is immutable (it had evolved the way it was and in need of a clean-up sweep for a long time)
This commit is contained in:
parent
a0de07d45b
commit
d43a47efca
7 changed files with 91 additions and 76 deletions
|
@ -95,14 +95,6 @@ namespace Catch {
|
|||
return getCurrentMutableContext();
|
||||
}
|
||||
|
||||
Stream createStream( std::string const& streamName ) {
|
||||
if( streamName == "stdout" ) return Stream( Catch::cout().rdbuf(), false );
|
||||
if( streamName == "stderr" ) return Stream( Catch::cerr().rdbuf(), false );
|
||||
if( streamName == "debug" ) return Stream( new StreamBufImpl<OutputDebugWriter>, true );
|
||||
|
||||
throw std::domain_error( "Unknown stream: " + streamName );
|
||||
}
|
||||
|
||||
void cleanUpContext() {
|
||||
delete currentContext;
|
||||
currentContext = CATCH_NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue