mirror of
https://github.com/catchorg/Catch2.git
synced 2026-04-28 18:02:05 +02:00
Reduce the use of shared_ptrs for various Config objects
Ideally they would not be used at all, but the main config lifetime is a weird mess right now and will require further refactoring.
This commit is contained in:
@@ -33,14 +33,14 @@ namespace Catch {
|
||||
namespace {
|
||||
const int MaxExitCode = 255;
|
||||
|
||||
IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) {
|
||||
IStreamingReporterPtr createReporter(std::string const& reporterName, IConfig const* config) {
|
||||
auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
|
||||
CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'");
|
||||
|
||||
return reporter;
|
||||
}
|
||||
|
||||
IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
|
||||
IStreamingReporterPtr makeReporter(Config const* config) {
|
||||
if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
|
||||
return createReporter(config->getReporterName(), config);
|
||||
}
|
||||
@@ -273,7 +273,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
// Create reporter(s) so we can route listings through them
|
||||
auto reporter = makeReporter(m_config);
|
||||
auto reporter = makeReporter(m_config.get());
|
||||
|
||||
// Handle list request
|
||||
if (list(*reporter, m_config)) {
|
||||
|
||||
Reference in New Issue
Block a user