mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-13 18:09:33 +01:00
Fix section filtering to make sense
Specifically, this commit makes the `-c`/`--section` parameter strictly ordered and hierarchical, unlike how it behaved before, which was a huge mess -- see #3038 for details. Closes #3038
This commit is contained in:
@@ -129,12 +129,8 @@ namespace Catch {
|
||||
|
||||
for ( auto const& child : m_children ) {
|
||||
if ( child->isSectionTracker() &&
|
||||
std::find( filters.begin(),
|
||||
filters.end(),
|
||||
static_cast<SectionTracker const&>(
|
||||
*child )
|
||||
.trimmedName() ) !=
|
||||
filters.end() ) {
|
||||
static_cast<SectionTracker const&>( *child )
|
||||
.trimmedName() == filters[0] ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ namespace TestCaseTracking {
|
||||
bool SectionTracker::isComplete() const {
|
||||
bool complete = true;
|
||||
|
||||
if (m_filters.empty()
|
||||
if ( m_filters.empty()
|
||||
|| m_filters[0].empty()
|
||||
|| std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
|
||||
|| m_filters[0] == m_trimmed_name ) {
|
||||
complete = TrackerBase::isComplete();
|
||||
}
|
||||
return complete;
|
||||
|
||||
Reference in New Issue
Block a user