mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
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.
This commit is contained in:
parent
4e12e12c1f
commit
8255acf88f
@ -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 )
|
||||
|
||||
|
@ -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 )
|
||||
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -106,6 +106,6 @@ namespace Catch{
|
||||
const std::string MockReporter::recordTestCases = "[tc]";
|
||||
const std::string MockReporter::recordSections =" [s]";
|
||||
|
||||
INTERNAL_CATCH_REGISTER_REPORTER( "mock", MockReporter )
|
||||
INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "mock", MockReporter )
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user