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.
This commit is contained in:
Igor Akhmetov 2019-02-16 21:28:18 +03:00 committed by Jozef Grajciar
parent 093b72416d
commit 45ebf17ec7
1 changed files with 2 additions and 2 deletions

View File

@ -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"