diff options
| author | Phil Nash | 2012-11-30 19:29:03 +0000 |
|---|---|---|
| committer | Phil Nash | 2012-11-30 19:29:03 +0000 |
| commit | 8255acf88fa86e1e7d80ab48d7ee1d1c8b05b57a (patch) | |
| tree | 9b806c15256fd792547b012ff9a000156144629c /include | |
| parent | 4e12e12c1f60f20d5231229aba5c617348903547 (diff) | |
| download | catch3-8255acf88fa86e1e7d80ab48d7ee1d1c8b05b57a.tar.gz | |
IStreamingReporter is now the default. Use REGISTER_LEGACY_REPORTER to register… you guessed it: legacy reporters
The built-in reporters are still legacy at the moment.
Diffstat (limited to 'include')
| -rw-r--r-- | include/catch.hpp | 2 | ||||
| -rw-r--r-- | include/internal/catch_impl.hpp | 6 | ||||
| -rw-r--r-- | include/internal/catch_reporter_registrars.hpp | 15 |
3 files changed, 18 insertions, 5 deletions
diff --git a/include/catch.hpp b/include/catch.hpp index 54acd738..6fb0fd10 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -84,6 +84,7 @@ #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) @@ -126,6 +127,7 @@ #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) #define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) #define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 295bf773..014a6345 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -76,9 +76,9 @@ namespace Catch { void Config::dummy() {} - INTERNAL_CATCH_REGISTER_REPORTER( "basic", BasicReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "basic", BasicReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "xml", XmlReporter ) + INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "junit", JunitReporter ) } diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 77ed5374..3496999f 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -38,6 +38,17 @@ namespace Catch { class ReporterFactory : public IReporterFactory { + // *** Please Note ***: + // - If you end up here looking at a compiler error because it's trying to register + // your custom reporter class be aware that the native reporter interface has changed + // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via + // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. + // However please consider updating to the new interface as the old one is now + // deprecated and will probably be removed quite soon! + // Please contact me via github if you have any questions at all about this. + // In fact, ideally, please contact me anyway to let me know you've hit this - as I have + // no idea who is actually using custom reporters at all (possibly no-one!). + // The new interface is designed to minimise exposure to interface changes in the future. virtual IStreamingReporter* create( const ReporterConfig& config ) const { return new T( config ); } @@ -55,9 +66,9 @@ namespace Catch { }; } -#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ +#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ Catch::LegacyReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); -#define INTERNAL_CATCH_REGISTER_REPORTER2( name, reporterType ) \ +#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); #endif // TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED |