mirror of
https://github.com/catchorg/Catch2.git
synced 2025-10-14 14:15:40 +02:00
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:
@@ -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 );
|
||||
|
Reference in New Issue
Block a user