From f99f5111550ff55545e8a68713c9ea4a740e083a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 17 Aug 2017 18:07:24 +0200 Subject: [PATCH] Removed *_REGISTER_REPORTER from main path Also simplified them to single macro: CATCH_REGISTER_REPORTER --- include/catch.hpp | 4 ---- include/internal/catch_reporter_registrars.hpp | 2 +- include/reporters/catch_reporter_automake.hpp | 2 +- include/reporters/catch_reporter_compact.cpp | 2 +- include/reporters/catch_reporter_console.cpp | 2 +- include/reporters/catch_reporter_junit.cpp | 2 +- include/reporters/catch_reporter_tap.hpp | 2 +- include/reporters/catch_reporter_teamcity.hpp | 2 +- include/reporters/catch_reporter_xml.cpp | 2 +- 9 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/catch.hpp b/include/catch.hpp index f04ab7a5..4b149b4e 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -115,8 +115,6 @@ #define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() -#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) - // "BDD-style" convenience wrappers #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) @@ -175,8 +173,6 @@ #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE() -#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) - #endif #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) diff --git a/include/internal/catch_reporter_registrars.hpp b/include/internal/catch_reporter_registrars.hpp index 483003fe..74ee494e 100644 --- a/include/internal/catch_reporter_registrars.hpp +++ b/include/internal/catch_reporter_registrars.hpp @@ -54,7 +54,7 @@ namespace Catch { }; } -#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ +#define CATCH_REGISTER_REPORTER( name, reporterType ) \ namespace{ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } #define CATCH_REGISTER_LISTENER( listenerType ) \ diff --git a/include/reporters/catch_reporter_automake.hpp b/include/reporters/catch_reporter_automake.hpp index 86eb0325..dbebe975 100644 --- a/include/reporters/catch_reporter_automake.hpp +++ b/include/reporters/catch_reporter_automake.hpp @@ -55,7 +55,7 @@ namespace Catch { AutomakeReporter::~AutomakeReporter() {} #endif - INTERNAL_CATCH_REGISTER_REPORTER( "automake", AutomakeReporter) + CATCH_REGISTER_REPORTER( "automake", AutomakeReporter) } // end namespace Catch diff --git a/include/reporters/catch_reporter_compact.cpp b/include/reporters/catch_reporter_compact.cpp index a1bb108f..80f3767d 100644 --- a/include/reporters/catch_reporter_compact.cpp +++ b/include/reporters/catch_reporter_compact.cpp @@ -299,6 +299,6 @@ namespace Catch { CompactReporter::~CompactReporter() {} - INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter ) + CATCH_REGISTER_REPORTER( "compact", CompactReporter ) } // end namespace Catch diff --git a/include/reporters/catch_reporter_console.cpp b/include/reporters/catch_reporter_console.cpp index 0922134d..63fad69a 100644 --- a/include/reporters/catch_reporter_console.cpp +++ b/include/reporters/catch_reporter_console.cpp @@ -634,7 +634,7 @@ namespace Catch { bool m_headerPrinted = false; }; - INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) + CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) ConsoleReporter::~ConsoleReporter() {} diff --git a/include/reporters/catch_reporter_junit.cpp b/include/reporters/catch_reporter_junit.cpp index ae3ea384..b40e9619 100644 --- a/include/reporters/catch_reporter_junit.cpp +++ b/include/reporters/catch_reporter_junit.cpp @@ -251,6 +251,6 @@ namespace Catch { }; JunitReporter::~JunitReporter() {} - INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) + CATCH_REGISTER_REPORTER( "junit", JunitReporter ) } // end namespace Catch diff --git a/include/reporters/catch_reporter_tap.hpp b/include/reporters/catch_reporter_tap.hpp index 1d1093b8..47661598 100644 --- a/include/reporters/catch_reporter_tap.hpp +++ b/include/reporters/catch_reporter_tap.hpp @@ -248,7 +248,7 @@ namespace Catch { TAPReporter::~TAPReporter() {} #endif - INTERNAL_CATCH_REGISTER_REPORTER( "tap", TAPReporter ) + CATCH_REGISTER_REPORTER( "tap", TAPReporter ) } // end namespace Catch diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp index 15cfc016..3fcbbd4e 100644 --- a/include/reporters/catch_reporter_teamcity.hpp +++ b/include/reporters/catch_reporter_teamcity.hpp @@ -206,7 +206,7 @@ namespace Catch { TeamCityReporter::~TeamCityReporter() {} #endif - INTERNAL_CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter ) + CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter ) } // end namespace Catch diff --git a/include/reporters/catch_reporter_xml.cpp b/include/reporters/catch_reporter_xml.cpp index 128899a9..0033b310 100644 --- a/include/reporters/catch_reporter_xml.cpp +++ b/include/reporters/catch_reporter_xml.cpp @@ -220,6 +220,6 @@ namespace Catch { }; XmlReporter::~XmlReporter() {} - INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) + CATCH_REGISTER_REPORTER( "xml", XmlReporter ) } // end namespace Catch