Tweak to reporter registrar to make sure generated name is unique

This commit is contained in:
Phil Nash 2010-12-31 16:12:48 +00:00
parent 27fdf01b76
commit 245be004fe
6 changed files with 11 additions and 5 deletions

View File

@ -169,6 +169,8 @@ namespace Catch
const ReporterConfig& m_config;
bool m_firstSectionInTestCase;
};
CATCH_REGISTER_REPORTER( "basic", BasicReporter );
} // end namespace Catch

View File

@ -254,6 +254,8 @@ namespace Catch
std::ostringstream m_stdOut;
std::ostringstream m_stdErr;
};
CATCH_REGISTER_REPORTER( "junit", JunitReporter );
} // end namespace Catch

View File

@ -150,6 +150,8 @@ namespace Catch
XmlWriter m_xml;
};
CATCH_REGISTER_REPORTER( "xml", XmlReporter );
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED

View File

@ -23,10 +23,6 @@ namespace Catch
{
inline int Main( int argc, char * const argv[] )
{
ReporterRegistry::instance().registerReporter<BasicReporter>( "basic" );
ReporterRegistry::instance().registerReporter<XmlReporter>( "xml" );
ReporterRegistry::instance().registerReporter<JunitReporter>( "junit" );
RunnerConfig config;
ArgParser( argc, argv, config );

View File

@ -18,6 +18,10 @@
namespace Catch
{
// !TBD: This could be refactored to be more "declarative"
// have a table up front that relates the mode, option strings, # arguments, names of arguments
// - may not be worth it at this scale
// -l, --list tests [xml] lists available tests (optionally in xml)
// -l, --list reporters [xml] lists available reports (optionally in xml)
// -l, --list all [xml] lists available tests and reports (optionally in xml)

View File

@ -180,6 +180,6 @@ namespace Catch
};
}
#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar<reporterType> INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ReporterReg )( name );
#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name );
#endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED