diff options
| author | Martin Hořeňovský | 2021-01-16 15:48:22 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-01-16 15:48:29 +0100 |
| commit | 5509ceff608aafc402116a081200f3ff2b4805ed (patch) | |
| tree | 4357e9fecf9129b616572adccb9bfa3ecec90327 /src/catch2/interfaces/catch_interfaces_reporter.cpp | |
| parent | 74f2f4ba5e84355e4f123ec807c1ec3b29a0daa7 (diff) | |
| download | catch3-5509ceff608aafc402116a081200f3ff2b4805ed.tar.gz | |
Remove superfluous IConfig argument from IStreamingReporter::list*
The previous commit made it so that the `IConfig` is stored in
`IStreamingReporter` and thus always available.
Diffstat (limited to 'src/catch2/interfaces/catch_interfaces_reporter.cpp')
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.cpp | 21 |
1 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 948869e7..1fd6b6d1 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -127,14 +127,14 @@ namespace Catch { void IStreamingReporter::fatalErrorEncountered( StringRef ) {} - void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions, IConfig const& config) { + void IStreamingReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { 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(); }) ->name.size(); for (auto const& desc : descriptions) { - if (config.verbosity() == Verbosity::Quiet) { + if (m_config->verbosity() == Verbosity::Quiet) { Catch::cout() << TextFlow::Column(desc.name) .indent(2) @@ -154,16 +154,16 @@ namespace Catch { Catch::cout() << std::endl; } - void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests, IConfig const& config) { + void IStreamingReporter::listTests(std::vector<TestCaseHandle> const& tests) { // We special case this to provide the equivalent of old // `--list-test-names-only`, which could then be used by the // `--input-file` option. - if (config.verbosity() == Verbosity::Quiet) { + if (m_config->verbosity() == Verbosity::Quiet) { listTestNamesOnly(tests); return; } - if (config.hasTestFilters()) { + if (m_config->hasTestFilters()) { Catch::cout() << "Matching test cases:\n"; } else { Catch::cout() << "All available test cases:\n"; @@ -177,23 +177,24 @@ namespace Catch { Colour colourGuard(colour); Catch::cout() << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n'; - if (config.verbosity() >= Verbosity::High) { + if (m_config->verbosity() >= Verbosity::High) { Catch::cout() << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl; } - if (!testCaseInfo.tags.empty() && config.verbosity() > Verbosity::Quiet) { + if ( !testCaseInfo.tags.empty() && + m_config->verbosity() > Verbosity::Quiet ) { Catch::cout() << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n'; } } - if (!config.hasTestFilters()) { + if (!m_config->hasTestFilters()) { Catch::cout() << pluralise(tests.size(), "test case") << '\n' << std::endl; } else { Catch::cout() << pluralise(tests.size(), "matching test case") << '\n' << std::endl; } } - void IStreamingReporter::listTags(std::vector<TagInfo> const& tags, IConfig const& config) { - if (config.hasTestFilters()) { + void IStreamingReporter::listTags(std::vector<TagInfo> const& tags) { + if (m_config->hasTestFilters()) { Catch::cout() << "Tags for matching test cases:\n"; } else { Catch::cout() << "All available tags:\n"; |