mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-22 04:38:46 +00:00
First attempt at data generator support
The support is to be considered experimental, that is, the interfaces, the first party generators and helper functions can change or be removed at any point in time. Related to #850
This commit is contained in:
parent
7f18282d17
commit
7c25dae9ea
12 changed files with 656 additions and 16 deletions
|
@ -69,14 +69,6 @@ namespace TestCaseTracking {
|
|||
}
|
||||
|
||||
|
||||
|
||||
TrackerBase::TrackerHasName::TrackerHasName( NameAndLocation const& nameAndLocation ) : m_nameAndLocation( nameAndLocation ) {}
|
||||
bool TrackerBase::TrackerHasName::operator ()( ITrackerPtr const& tracker ) const {
|
||||
return
|
||||
tracker->nameAndLocation().location == m_nameAndLocation.location &&
|
||||
tracker->nameAndLocation().name == m_nameAndLocation.name;
|
||||
}
|
||||
|
||||
TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
|
||||
: m_nameAndLocation( nameAndLocation ),
|
||||
m_ctx( ctx ),
|
||||
|
@ -105,7 +97,12 @@ namespace TestCaseTracking {
|
|||
}
|
||||
|
||||
ITrackerPtr TrackerBase::findChild( NameAndLocation const& nameAndLocation ) {
|
||||
auto it = std::find_if( m_children.begin(), m_children.end(), TrackerHasName( nameAndLocation ) );
|
||||
auto it = std::find_if( m_children.begin(), m_children.end(),
|
||||
[&nameAndLocation]( ITrackerPtr const& tracker ){
|
||||
return
|
||||
tracker->nameAndLocation().location == nameAndLocation.location &&
|
||||
tracker->nameAndLocation().name == nameAndLocation.name;
|
||||
} );
|
||||
return( it != m_children.end() )
|
||||
? *it
|
||||
: nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue