From 45ebf17ec79f4522419fa2eba826391ae916af5e Mon Sep 17 00:00:00 2001 From: Igor Akhmetov Date: Sat, 16 Feb 2019 21:28:18 +0300 Subject: [PATCH] Do not open the output file twice 7f229b4f caused the output file to get opened twice, while some types of files (e.g. named pipes) can be only opened once. After this change Session::applyCommandLine opens the output file only when there is an error to print. --- include/internal/catch_session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_session.cpp b/include/internal/catch_session.cpp index 44b45dbc..a5907e97 100644 --- a/include/internal/catch_session.cpp +++ b/include/internal/catch_session.cpp @@ -171,9 +171,9 @@ namespace Catch { return 1; auto result = m_cli.parse( clara::Args( argc, argv ) ); - config(); - getCurrentMutableContext().setConfig( m_config ); if( !result ) { + config(); + getCurrentMutableContext().setConfig(m_config); Catch::cerr() << Colour( Colour::Red ) << "\nError(s) in input:\n"