diff options
| author | Martin Hořeňovský | 2025-10-14 22:14:47 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-10-16 09:16:56 +0200 |
| commit | 49d79e9e9c40e644304945dd5a8e4e78d0c61d10 (patch) | |
| tree | ab0ed18db89b464e8e36f4964cd91af2bd6b4135 /src/catch2/internal/catch_run_context.cpp | |
| parent | 33e6fd217aee285eca97bef175df716264088b8a (diff) | |
| download | catch3-49d79e9e9c40e644304945dd5a8e4e78d0c61d10.tar.gz | |
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
Diffstat (limited to 'src/catch2/internal/catch_run_context.cpp')
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index 0029bf56..37045f60 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -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; } } |