From d43024ff6bc3179576d899aecfc1c1d5bc884c25 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 18 Jul 2017 18:03:57 +0100 Subject: [PATCH] Removed intermediate IConfig ptr --- include/catch_session.hpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/include/catch_session.hpp b/include/catch_session.hpp index 7acf80a6..8ebe88ca 100644 --- a/include/catch_session.hpp +++ b/include/catch_session.hpp @@ -50,12 +50,10 @@ namespace Catch { Totals runTests( std::shared_ptr const& config ) { - IConfigPtr iconfig = config; - IStreamingReporterPtr reporter = makeReporter( config ); - addListeners( reporter, iconfig ); + addListeners( reporter, config ); - RunContext context( iconfig, std::move( reporter ) ); + RunContext context( config, std::move( reporter ) ); Totals totals; @@ -65,15 +63,15 @@ namespace Catch { if( !testSpec.hasFilters() ) testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests - std::vector const& allTestCases = getAllTestCasesSorted( *iconfig ); + std::vector const& allTestCases = getAllTestCasesSorted( *config ); for( auto const& testCase : allTestCases ) { - if( !context.aborting() && matchTest( testCase, testSpec, *iconfig ) ) + if( !context.aborting() && matchTest( testCase, testSpec, *config ) ) totals += context.runTest( testCase ); else context.reporter().skipTest( testCase ); } - context.testGroupEnded( iconfig->name(), totals, 1, 1 ); + context.testGroupEnded( config->name(), totals, 1, 1 ); return totals; } @@ -96,6 +94,7 @@ namespace Catch { } } + class Session : NonCopyable { static const int MaxExitCode; public: @@ -112,10 +111,10 @@ namespace Catch { } void showHelp() { - Catch::cout() << "\nCatch v" << libraryVersion() << "\n"; - - Catch::cout() << m_cli << std::endl; - Catch::cout() << "For more detailed usage please see the project docs\n" << std::endl; + Catch::cout() + << "\nCatch v" << libraryVersion() << "\n" + << m_cli << std::endl + << "For more detailed usage please see the project docs\n" << std::endl; } int applyCommandLine( int argc, char* argv[] ) { @@ -138,8 +137,8 @@ namespace Catch { return 0; } - void useConfigData( ConfigData const& _configData ) { - m_configData = _configData; + void useConfigData( ConfigData const& configData ) { + m_configData = configData; m_config.reset(); }