fix SEGFAULTs

issue was that mutable context had no config thus trying to get stream
caused SEGFAULT

Closes #1533, #1534
This commit is contained in:
Jozef Grajciar
2019-02-08 10:41:23 +01:00
parent c03b23c84b
commit 7f229b4ff1
3 changed files with 15 additions and 10 deletions

View File

@@ -10,6 +10,7 @@
#include "catch_console_colour.h"
#include "catch_enforce.h"
#include "catch_list.h"
#include "catch_context.h"
#include "catch_run_context.h"
#include "catch_stream.h"
#include "catch_test_spec.h"
@@ -170,6 +171,8 @@ namespace Catch {
return 1;
auto result = m_cli.parse( clara::Args( argc, argv ) );
config();
getCurrentMutableContext().setConfig( m_config );
if( !result ) {
Catch::cerr()
<< Colour( Colour::Red )
@@ -262,7 +265,7 @@ namespace Catch {
applyFilenamesAsTags( *m_config );
// Handle list request
if( Option<std::size_t> listed = list( config() ) )
if( Option<std::size_t> listed = list( m_config ) )
return static_cast<int>( *listed );
auto totals = runTests( m_config );