diff --git a/catch_reporter_basic.hpp b/catch_reporter_basic.hpp index 427b4d01..37e5a1d8 100644 --- a/catch_reporter_basic.hpp +++ b/catch_reporter_basic.hpp @@ -169,6 +169,8 @@ namespace Catch const ReporterConfig& m_config; bool m_firstSectionInTestCase; }; + + CATCH_REGISTER_REPORTER( "basic", BasicReporter ); } // end namespace Catch diff --git a/catch_reporter_junit.hpp b/catch_reporter_junit.hpp index 1d9f39ca..e71a47d2 100644 --- a/catch_reporter_junit.hpp +++ b/catch_reporter_junit.hpp @@ -254,6 +254,8 @@ namespace Catch std::ostringstream m_stdOut; std::ostringstream m_stdErr; }; + + CATCH_REGISTER_REPORTER( "junit", JunitReporter ); } // end namespace Catch diff --git a/catch_reporter_xml.hpp b/catch_reporter_xml.hpp index 31ec426f..848eb93e 100644 --- a/catch_reporter_xml.hpp +++ b/catch_reporter_xml.hpp @@ -150,6 +150,8 @@ namespace Catch XmlWriter m_xml; }; + CATCH_REGISTER_REPORTER( "xml", XmlReporter ); + } // end namespace Catch #endif // TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED diff --git a/catch_runner.hpp b/catch_runner.hpp index 37060b99..ea0dbfa0 100644 --- a/catch_runner.hpp +++ b/catch_runner.hpp @@ -23,10 +23,6 @@ namespace Catch { inline int Main( int argc, char * const argv[] ) { - ReporterRegistry::instance().registerReporter( "basic" ); - ReporterRegistry::instance().registerReporter( "xml" ); - ReporterRegistry::instance().registerReporter( "junit" ); - RunnerConfig config; ArgParser( argc, argv, config ); diff --git a/internal/catch_commandline.hpp b/internal/catch_commandline.hpp index 3e80603a..dac7a567 100644 --- a/internal/catch_commandline.hpp +++ b/internal/catch_commandline.hpp @@ -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) diff --git a/internal/catch_reporter_registry.hpp b/internal/catch_reporter_registry.hpp index b9996774..455108fb 100644 --- a/internal/catch_reporter_registry.hpp +++ b/internal/catch_reporter_registry.hpp @@ -180,6 +180,6 @@ namespace Catch }; } -#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ReporterReg )( name ); +#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); #endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED \ No newline at end of file