Renamed RunnerConfig to just Config (now its the only one)

This commit is contained in:
Phil Nash 2011-01-01 00:20:14 +00:00
parent 50712a34c3
commit 949d9ead04
5 changed files with 22 additions and 22 deletions

View File

@ -26,7 +26,7 @@ namespace Catch
{
inline int Main( int argc, char * const argv[] )
{
RunnerConfig config;
Config config;
ArgParser( argc, argv, config );
if( !config.m_message.empty() )
@ -57,7 +57,7 @@ namespace Catch
}
// Handle list request
if( config.listWhat() != RunnerConfig::listNone )
if( config.listWhat() != Config::listNone )
return List( config );
// Open output file, if specified

View File

@ -47,7 +47,7 @@ namespace Catch
};
public:
ArgParser( int argc, char * const argv[], RunnerConfig& config )
ArgParser( int argc, char * const argv[], Config& config )
: m_mode( modeNone ),
m_config( config )
{
@ -112,26 +112,26 @@ namespace Catch
}
else
{
RunnerConfig::ListInfo listSpec = RunnerConfig::listAll;
Config::ListInfo listSpec = Config::listAll;
if( m_args.size() >= 1 )
{
if( m_args[0] == "tests" )
listSpec = RunnerConfig::listTests;
listSpec = Config::listTests;
else if( m_args[0] == "reporters" )
listSpec = RunnerConfig::listReports;
listSpec = Config::listReports;
else
return setErrorMode( m_command + " expected [tests] or [reporters] but recieved: [" + m_args[0] + "]" );
}
if( m_args.size() >= 2 )
{
if( m_args[1] == "xml" )
listSpec = (RunnerConfig::ListInfo)( listSpec | RunnerConfig::listAsXml );
listSpec = (Config::ListInfo)( listSpec | Config::listAsXml );
else if( m_args[1] == "text" )
listSpec = (RunnerConfig::ListInfo)( listSpec | RunnerConfig::listAsText );
listSpec = (Config::ListInfo)( listSpec | Config::listAsText );
else
return setErrorMode( m_command + " expected [xml] or [text] but recieved: [" + m_args[1] + "]" );
}
m_config.m_listSpec = (RunnerConfig::ListInfo)( m_config.m_listSpec | listSpec );
m_config.m_listSpec = (Config::ListInfo)( m_config.m_listSpec | listSpec );
}
break;
case modeTest:
@ -157,7 +157,7 @@ namespace Catch
case modeSuccess:
if( m_args.size() != 0 )
return setErrorMode( m_command + " does not accept arguments" );
m_config.setIncludeWhat( RunnerConfig::Include::SuccessfulResults );
m_config.setIncludeWhat( Config::Include::SuccessfulResults );
break;
case modeBreak:
if( m_args.size() != 0 )
@ -188,7 +188,7 @@ namespace Catch
Mode m_mode;
std::string m_command;
std::vector<std::string> m_args;
RunnerConfig& m_config;
Config& m_config;
};

View File

@ -18,9 +18,9 @@
namespace Catch
{
inline int List( const RunnerConfig& config )
inline int List( const Config& config )
{
if( config.listWhat() & RunnerConfig::listReports )
if( config.listWhat() & Config::listReports )
{
std::cout << "Available reports:\n";
IReporterRegistry::FactoryMap::const_iterator it = Hub::getReporterRegistry().getFactories().begin();
@ -32,7 +32,7 @@ namespace Catch
}
std::cout << std::endl;
}
if( config.listWhat() & RunnerConfig::listTests )
if( config.listWhat() & Config::listTests )
{
std::cout << "Available tests:\n";
std::vector<TestCaseInfo>::const_iterator it = TestRegistry::instance().getAllTests().begin();
@ -44,7 +44,7 @@ namespace Catch
}
std::cout << std::endl;
}
if( ( config.listWhat() & RunnerConfig::listAll ) == 0 )
if( ( config.listWhat() & Config::listAll ) == 0 )
{
std::cerr << "Unknown list type" << std::endl;
return std::numeric_limits<int>::max();

View File

@ -76,7 +76,7 @@ namespace Catch
void operator =( const Runner& );
public:
explicit Runner( const RunnerConfig& config )
explicit Runner( const Config& config )
: m_config( config ),
m_successes( 0 ),
m_failures( 0 ),
@ -248,7 +248,7 @@ namespace Catch
private:
MutableResultInfo m_currentResult;
const RunnerConfig& m_config;
const Config& m_config;
std::size_t m_successes;
std::size_t m_failures;
IReporter* m_reporter;

View File

@ -21,11 +21,11 @@
namespace Catch
{
class RunnerConfig : public IReporterConfig
class Config : public IReporterConfig
{
private:
RunnerConfig( const RunnerConfig& other );
RunnerConfig& operator = ( const RunnerConfig& other );
Config( const Config& other );
Config& operator = ( const Config& other );
public:
struct Include { enum What
@ -51,7 +51,7 @@ namespace Catch
};
RunnerConfig()
Config()
: m_reporter( NULL ),
m_listSpec( listNone ),
m_shouldDebugBreak( false ),
@ -105,7 +105,7 @@ namespace Catch
IReporter* getReporter() const
{
return const_cast<RunnerConfig*>( this )->getReporter();
return const_cast<Config*>( this )->getReporter();
}
ListInfo listWhat() const