Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_run_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-10-14 22:14:47 +0200
committerMartin Hořeňovský2025-10-16 09:16:56 +0200
commit49d79e9e9c40e644304945dd5a8e4e78d0c61d10 (patch)
treeab0ed18db89b464e8e36f4964cd91af2bd6b4135 /src/catch2/internal/catch_run_context.cpp
parent33e6fd217aee285eca97bef175df716264088b8a (diff)
downloadcatch3-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.cpp8
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;
}
}