mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Do not use shared_ptr<Config> when listing things
This commit is contained in:
parent
fa160cf3f2
commit
458241cc90
@ -273,11 +273,14 @@ namespace Catch {
|
|||||||
applyFilenamesAsTags();
|
applyFilenamesAsTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up global config instance before we start calling into other functions
|
||||||
|
getCurrentMutableContext().setConfig(m_config);
|
||||||
|
|
||||||
// Create reporter(s) so we can route listings through them
|
// Create reporter(s) so we can route listings through them
|
||||||
auto reporter = makeReporter(m_config.get());
|
auto reporter = makeReporter(m_config.get());
|
||||||
|
|
||||||
// Handle list request
|
// Handle list request
|
||||||
if (list(*reporter, m_config)) {
|
if (list(*reporter, *m_config)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,20 +90,19 @@ namespace Catch {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool list( IStreamingReporter& reporter, std::shared_ptr<Config> const& config ) {
|
bool list( IStreamingReporter& reporter, Config const& config ) {
|
||||||
bool listed = false;
|
bool listed = false;
|
||||||
getCurrentMutableContext().setConfig( config );
|
if (config.listTests()) {
|
||||||
if (config->listTests()) {
|
|
||||||
listed = true;
|
listed = true;
|
||||||
listTests(reporter, *config);
|
listTests(reporter, config);
|
||||||
}
|
}
|
||||||
if (config->listTags()) {
|
if (config.listTags()) {
|
||||||
listed = true;
|
listed = true;
|
||||||
listTags(reporter, *config);
|
listTags(reporter, config);
|
||||||
}
|
}
|
||||||
if (config->listReporters()) {
|
if (config.listReporters()) {
|
||||||
listed = true;
|
listed = true;
|
||||||
listReporters(reporter, *config);
|
listReporters(reporter, config);
|
||||||
}
|
}
|
||||||
return listed;
|
return listed;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace Catch {
|
|||||||
std::size_t count = 0;
|
std::size_t count = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool list( IStreamingReporter& reporter, std::shared_ptr<Config> const& config );
|
bool list( IStreamingReporter& reporter, Config const& config );
|
||||||
|
|
||||||
} // end namespace Catch
|
} // end namespace Catch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user