mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Runner -> RunContext, Runner2 -> Runner and fixed issue with processName
This commit is contained in:
@@ -122,10 +122,10 @@ namespace Catch {
|
||||
bool listTags() const { return m_data.listTags; }
|
||||
bool listReporters() const { return m_data.listReporters; }
|
||||
|
||||
std::string getName() const {
|
||||
return m_data.name;
|
||||
std::string getProcessName() const {
|
||||
return m_data.processName;
|
||||
}
|
||||
|
||||
|
||||
bool shouldDebugBreak() const {
|
||||
return m_data.shouldDebugBreak;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace Catch {
|
||||
// IConfig interface
|
||||
virtual bool allowThrows() const { return !m_data.noThrow; }
|
||||
virtual std::ostream& stream() const { return m_os; }
|
||||
virtual std::string name() const { return m_data.name; }
|
||||
virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
|
||||
virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
|
||||
virtual bool warnAboutMissingAssertions() const { return m_data.warnings & ConfigData::WarnAbout::NoAssertions; }
|
||||
|
||||
|
@@ -49,14 +49,14 @@ namespace Catch {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Runner : public IResultCapture, public IRunner {
|
||||
class RunContext : public IResultCapture, public IRunner {
|
||||
|
||||
Runner( Runner const& );
|
||||
void operator =( Runner const& );
|
||||
RunContext( RunContext const& );
|
||||
void operator =( RunContext const& );
|
||||
|
||||
public:
|
||||
|
||||
explicit Runner( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> const& reporter )
|
||||
explicit RunContext( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> const& reporter )
|
||||
: m_runInfo( config->name() ),
|
||||
m_context( getCurrentMutableContext() ),
|
||||
m_runningTest( NULL ),
|
||||
@@ -72,7 +72,7 @@ namespace Catch {
|
||||
m_reporter->testRunStarting( m_runInfo );
|
||||
}
|
||||
|
||||
virtual ~Runner() {
|
||||
virtual ~RunContext() {
|
||||
m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
|
||||
m_context.setRunner( m_prevRunner );
|
||||
m_context.setConfig( NULL );
|
||||
|
@@ -458,7 +458,11 @@ namespace Clara {
|
||||
}
|
||||
|
||||
std::vector<Parser::Token> parseInto( int argc, char const * const * argv, ConfigT& config ) const {
|
||||
m_boundProcessName.set( config, argv[0] );
|
||||
std::string processName = argv[0];
|
||||
std::size_t lastSlash = processName.find_last_of( "/\\" );
|
||||
if( lastSlash != std::string::npos )
|
||||
processName = processName.substr( lastSlash+1 );
|
||||
m_boundProcessName.set( config, processName );
|
||||
std::vector<Parser::Token> tokens;
|
||||
Parser parser;
|
||||
parser.parseIntoTokens( argc, argv, tokens );
|
||||
|
Reference in New Issue
Block a user