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

View File

@ -171,9 +171,9 @@ namespace Catch {
return 1;
auto result = m_cli.parse( clara::Args( argc, argv ) );
if( !result ) {
config();
getCurrentMutableContext().setConfig(m_config);
if( !result ) {
Catch::cerr()
<< Colour( Colour::Red )
<< "\nError(s) in input:\n"