Listing is now in terms of interface (and calls to bool functions)

This commit is contained in:
Phil Nash
2013-05-29 07:59:01 +01:00
parent 6b8837bd93
commit f6892bfdf0
3 changed files with 31 additions and 34 deletions

View File

@@ -24,8 +24,8 @@ namespace Catch {
class Runner2 { // This will become Runner when Runner becomes Context
public:
Runner2( ConfigData const& config )
: m_config( new Config( config ) )
Runner2( Ptr<Config> const& config )
: m_config( config )
{
openStream();
makeReporter();
@@ -110,15 +110,14 @@ namespace Catch {
std::set<TestCase> m_testsAlreadyRun;
};
inline int Main( ConfigData const& configData ) {
inline int Main( Ptr<Config> const& config ) {
int result = 0;
try
{
Runner2 runner( configData );
Runner2 runner( config );
// Handle list request
if( configData.listSpec != List::None ) {
list( configData );
if( list( config ) ) {
Catch::cleanUp();
return 0;
}
@@ -195,8 +194,8 @@ namespace Catch {
Catch::cleanUp();
return (std::numeric_limits<int>::max)();
}
return Main( configData );
Ptr<Config> config = new Config( configData );
return Main( config );
}
} // end namespace Catch