mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 23:19:32 +00:00
First cut of new filtering mechanism
This commit is contained in:
parent
b354da9ab9
commit
56d5c42912
14 changed files with 1535 additions and 1365 deletions
|
@ -52,25 +52,33 @@ namespace Catch {
|
|||
return m_nonHiddenFunctions;
|
||||
}
|
||||
|
||||
// !TBD deprecated
|
||||
virtual std::vector<TestCaseInfo> getMatchingTestCases( const std::string& rawTestSpec ) const {
|
||||
TestSpec testSpec( rawTestSpec );
|
||||
|
||||
std::vector<TestCaseInfo> matchingTests;
|
||||
getMatchingTestCases( rawTestSpec, matchingTests );
|
||||
return matchingTests;
|
||||
}
|
||||
|
||||
// !TBD deprecated
|
||||
virtual void getMatchingTestCases( const std::string& rawTestSpec, std::vector<TestCaseInfo>& matchingTestsOut ) const {
|
||||
TestSpec testSpec( rawTestSpec );
|
||||
TestCaseFilter filter( rawTestSpec );
|
||||
|
||||
std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
|
||||
std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
|
||||
for(; it != itEnd; ++it ) {
|
||||
if( testSpec.matches( it->getName() ) ) {
|
||||
if( filter.shouldInclude( *it ) ) {
|
||||
matchingTestsOut.push_back( *it );
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void getMatchingTestCases( const TestCaseFilters& filters, std::vector<TestCaseInfo>& matchingTestsOut ) const {
|
||||
std::vector<TestCaseInfo>::const_iterator it = m_functionsInOrder.begin();
|
||||
std::vector<TestCaseInfo>::const_iterator itEnd = m_functionsInOrder.end();
|
||||
// !TBD: replace with algorithm
|
||||
for(; it != itEnd; ++it )
|
||||
if( filters.shouldInclude( *it ) )
|
||||
matchingTestsOut.push_back( *it );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue