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

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_test_spec.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-11-04 21:35:57 +0100
committerMartin Hořeňovský2019-11-14 10:52:34 +0100
commit302e2c0b06f131199b97ad33bdebacc359782ff0 (patch)
tree26e80b38b48739573de4225e789096ec83c79357 /include/internal/catch_test_spec.cpp
parent019b0a0fe0398a5b73937b9a1901b3dfaecac386 (diff)
downloadcatch3-302e2c0b06f131199b97ad33bdebacc359782ff0.tar.gz
Do not copy around TestCaseInfo
Now a `TEST_CASE` macro should create a single TestCaseInfo and then it should never be copied around. This, together with latter changes, should significantly decrease the number of allocations made before `main` is even entered.
Diffstat (limited to 'include/internal/catch_test_spec.cpp')
-rw-r--r--include/internal/catch_test_spec.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/internal/catch_test_spec.cpp b/include/internal/catch_test_spec.cpp
index 4610c1a9..0292673a 100644
--- a/include/internal/catch_test_spec.cpp
+++ b/include/internal/catch_test_spec.cpp
@@ -84,13 +84,13 @@ namespace Catch {
return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
}
- TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const
+ TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const
{
Matches matches( m_filters.size() );
std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){
- std::vector<TestCase const*> currentMatches;
+ std::vector<TestCaseHandle const*> currentMatches;
for( auto const& test : testCases )
- if( isThrowSafe( test, config ) && filter.matches( test ) )
+ if( isThrowSafe( test, config ) && filter.matches( test.getTestCaseInfo() ) )
currentMatches.emplace_back( &test );
return FilterMatch{ filter.name(), currentMatches };
} );