Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::Generators::GeneratorTracker Struct Reference
Inheritance diagram for Catch::Generators::GeneratorTracker:
Collaboration diagram for Catch::Generators::GeneratorTracker:

Public Member Functions

 GeneratorTracker (TestCaseTracking::NameAndLocation const &nameAndLocation, TrackerContext &ctx, ITracker *parent)
 
 ~GeneratorTracker ()
 
bool isGeneratorTracker () const override
 
auto hasGenerator () const -> bool override
 
void close () override
 
auto getGenerator () const -> GeneratorBasePtr const &override
 
void setGenerator (GeneratorBasePtr &&generator) override
 
- Public Member Functions inherited from Catch::TestCaseTracking::TrackerBase
 TrackerBase (NameAndLocation const &nameAndLocation, TrackerContext &ctx, ITracker *parent)
 
NameAndLocation const & nameAndLocation () const override
 
bool isComplete () const override
 
bool isSuccessfullyCompleted () const override
 
bool isOpen () const override
 
bool hasChildren () const override
 
void addChild (ITrackerPtr const &child) override
 
ITrackerPtr findChild (NameAndLocation const &nameAndLocation) override
 
ITrackerparent () override
 
void openChild () override
 
bool isSectionTracker () const override
 
bool isGeneratorTracker () const override
 
void open ()
 
void close () override
 
void fail () override
 
void markAsNeedingAnotherRun () override
 
- Public Member Functions inherited from Catch::TestCaseTracking::ITracker
virtual ~ITracker ()
 
- Public Member Functions inherited from Catch::IGeneratorTracker
virtual ~IGeneratorTracker ()
 
virtual ~IGeneratorTracker ()
 

Static Public Member Functions

static GeneratorTrackeracquire (TrackerContext &ctx, TestCaseTracking::NameAndLocation const &nameAndLocation)
 

Public Attributes

GeneratorBasePtr m_generator
 

Additional Inherited Members

- Protected Types inherited from Catch::TestCaseTracking::TrackerBase
enum  CycleState {
  NotStarted , Executing , ExecutingChildren , NeedsAnotherRun ,
  CompletedSuccessfully , Failed
}
 
using Children = std::vector<ITrackerPtr>
 
- Protected Attributes inherited from Catch::TestCaseTracking::TrackerBase
NameAndLocation m_nameAndLocation
 
TrackerContextm_ctx
 
ITrackerm_parent
 
Children m_children
 
CycleState m_runState = NotStarted
 

Detailed Description

Definition at line 16 of file catch_run_context.cpp.

Constructor & Destructor Documentation

◆ GeneratorTracker()

Catch::Generators::GeneratorTracker::GeneratorTracker ( TestCaseTracking::NameAndLocation const & nameAndLocation,
TrackerContext & ctx,
ITracker * parent )
inline

Definition at line 19 of file catch_run_context.cpp.

20 : TrackerBase( nameAndLocation, ctx, parent )
21 {}
NameAndLocation const & nameAndLocation() const override
TrackerBase(NameAndLocation const &nameAndLocation, TrackerContext &ctx, ITracker *parent)

◆ ~GeneratorTracker()

Catch::Generators::GeneratorTracker::~GeneratorTracker ( )

Definition at line 67 of file catch_run_context.cpp.

67{}

Member Function Documentation

◆ acquire()

static GeneratorTracker & Catch::Generators::GeneratorTracker::acquire ( TrackerContext & ctx,
TestCaseTracking::NameAndLocation const & nameAndLocation )
inlinestatic

Definition at line 24 of file catch_run_context.cpp.

24 {
25 std::shared_ptr<GeneratorTracker> tracker;
26
27 ITracker& currentTracker = ctx.currentTracker();
28 if( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
29 assert( childTracker );
30 assert( childTracker->isGeneratorTracker() );
31 tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
32 }
33 else {
34 tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, &currentTracker );
35 currentTracker.addChild( tracker );
36 }
37
38 if( !ctx.completedCycle() && !tracker->isComplete() ) {
39 tracker->open();
40 }
41
42 return *tracker;
43 }
std::shared_ptr< ITracker > ITrackerPtr
Here is the call graph for this function:

◆ close()

void Catch::Generators::GeneratorTracker::close ( )
inlineoverridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 50 of file catch_run_context.cpp.

50 {
51 TrackerBase::close();
52 // Generator interface only finds out if it has another item on atual move
54 m_children.clear();
56 }
57 }

◆ getGenerator()

auto Catch::Generators::GeneratorTracker::getGenerator ( ) const -> GeneratorBasePtr const&
inlineoverridevirtual

Implements Catch::IGeneratorTracker.

Definition at line 60 of file catch_run_context.cpp.

60 {
61 return m_generator;
62 }

◆ hasGenerator()

auto Catch::Generators::GeneratorTracker::hasGenerator ( ) const -> bool
inlineoverridevirtual

Implements Catch::IGeneratorTracker.

Definition at line 47 of file catch_run_context.cpp.

47 {
48 return !!m_generator;
49 }

◆ isGeneratorTracker()

bool Catch::Generators::GeneratorTracker::isGeneratorTracker ( ) const
inlineoverridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 46 of file catch_run_context.cpp.

46{ return true; }

◆ setGenerator()

void Catch::Generators::GeneratorTracker::setGenerator ( GeneratorBasePtr && generator)
inlineoverridevirtual

Implements Catch::IGeneratorTracker.

Definition at line 63 of file catch_run_context.cpp.

63 {
64 m_generator = std::move( generator );
65 }

Member Data Documentation

◆ m_generator

GeneratorBasePtr Catch::Generators::GeneratorTracker::m_generator

Definition at line 17 of file catch_run_context.cpp.


The documentation for this struct was generated from the following file: