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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-09-07 21:20:02 +0200
committerMartin Hořeňovský2026-09-11 11:16:05 +0200
commited393f09c729a706fb1fa1f2aa1742e206a48b65 (patch)
treec7c7d02c6b6eabfb231c0d0f8cf5a259a25be06b /src
parent6a5075bf73273ecb83fca61efdfde2fa1a2690bf (diff)
downloadcatch3-ed393f09c729a706fb1fa1f2aa1742e206a48b65.tar.gz
Move filtered test cases into the FilterMatch instead of copying
Diffstat (limited to 'src')
-rw-r--r--src/catch2/catch_test_spec.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/catch2/catch_test_spec.cpp b/src/catch2/catch_test_spec.cpp
index f32f9864..f7c202df 100644
--- a/src/catch2/catch_test_spec.cpp
+++ b/src/catch2/catch_test_spec.cpp
@@ -113,12 +113,14 @@ namespace Catch {
matches.reserve( m_filters.size() );
for ( auto const& filter : m_filters ) {
std::vector<TestCaseHandle const*> currentMatches;
- for ( auto const& test : testCases )
+ for ( auto const& test : testCases ) {
if ( isThrowSafe( test, config ) &&
- filter.matches( test.getTestCaseInfo() ) )
+ filter.matches( test.getTestCaseInfo() ) ) {
currentMatches.emplace_back( &test );
- matches.push_back(
- FilterMatch{ extractFilterName( filter ), currentMatches } );
+ }
+ }
+ matches.push_back( FilterMatch{ extractFilterName( filter ),
+ CATCH_MOVE( currentMatches ) } );
}
return matches;
}