diff options
| author | Martin Hořeňovský | 2020-08-11 09:34:25 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-08-11 09:39:00 +0200 |
| commit | 6dc834526103e3b9ee7fab26a69cd7942924bd91 (patch) | |
| tree | d0e24afeb76d611ee61a6b1440e87d1a11e910cb /src/catch2/interfaces | |
| parent | 24b83edf8aca78c975c5589baf22a5de311498a7 (diff) | |
| download | catch3-6dc834526103e3b9ee7fab26a69cd7942924bd91.tar.gz | |
IStreamingReporter::list* only uses IConfig instead of full Config
As the full `Config` is not needed, the TUs implementing the `list*`
functions can require the less heavy header `catch_interfaces_config.hpp`
instead of the much heavier `catch_config.hpp`.
This commit also fixes up some other TUs that include `Config`,
while using just `IConfig`, to cleanup the includes further.
Diffstat (limited to 'src/catch2/interfaces')
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.cpp | 11 | ||||
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.hpp | 10 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 7e4dd9ef..93a1baad 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -7,7 +7,6 @@ #include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> -#include <catch2/catch_config.hpp> #include <catch2/internal/catch_console_colour.hpp> #include <catch2/internal/catch_console_width.hpp> #include <catch2/catch_message.hpp> @@ -110,7 +109,7 @@ namespace Catch { void IStreamingReporter::fatalErrorEncountered( StringRef ) {} - void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions, Config const& config) { + void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) { Catch::cout() << "Available reporters:\n"; const auto maxNameLen = std::max_element(descriptions.begin(), descriptions.end(), [](ReporterDescription const& lhs, ReporterDescription const& rhs) { return lhs.name.size() < rhs.name.size(); }) @@ -137,10 +136,10 @@ namespace Catch { Catch::cout() << std::endl; } - void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, Config const& config) { - if (config.hasTestFilters()) + void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) { + if (config.hasTestFilters()) { Catch::cout() << "Matching test cases:\n"; - else { + } else { Catch::cout() << "All available test cases:\n"; } @@ -167,7 +166,7 @@ namespace Catch { } } - void IStreamingReporter::listTags(std::vector<TagInfo> const& tags, Config const& config) { + void IStreamingReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) { if (config.hasTestFilters()) { Catch::cout() << "Tags for matching test cases:\n"; } else { diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index a8cbbb5d..ba3d1ecd 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -234,10 +234,12 @@ namespace Catch { // Default empty implementation provided virtual void fatalErrorEncountered( StringRef name ); - // Listing support - virtual void listReporters(std::vector<ReporterDescription> const& descriptions, Config const& config); - virtual void listTests(std::vector<TestCaseHandle> const& tests, Config const& config); - virtual void listTags(std::vector<TagInfo> const& tags, Config const& config); + //! Writes out information about provided reporters using reporter-specific format + virtual void listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config); + //! Writes out information about provided tests using reporter-specific format + virtual void listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config); + //! Writes out information about the provided tags using reporter-specific format + virtual void listTags(std::vector<TagInfo> const& tags, IConfig const& config); }; using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; |