Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::TestCaseTracking::TrackerBase Class Reference

#include <catch_test_case_tracker.h>

Inheritance diagram for Catch::TestCaseTracking::TrackerBase:
Collaboration diagram for Catch::TestCaseTracking::TrackerBase:

Public Member Functions

 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 ()
 

Protected Types

enum  CycleState {
  NotStarted , Executing , ExecutingChildren , NeedsAnotherRun ,
  CompletedSuccessfully , Failed
}
 
using Children = std::vector<ITrackerPtr>
 

Protected Attributes

NameAndLocation m_nameAndLocation
 
TrackerContextm_ctx
 
ITrackerm_parent
 
Children m_children
 
CycleState m_runState = NotStarted
 

Detailed Description

Definition at line 85 of file catch_test_case_tracker.h.

Member Typedef Documentation

◆ Children

Definition at line 96 of file catch_test_case_tracker.h.

Member Enumeration Documentation

◆ CycleState

Constructor & Destructor Documentation

◆ TrackerBase()

Catch::TestCaseTracking::TrackerBase::TrackerBase ( NameAndLocation const & nameAndLocation,
TrackerContext & ctx,
ITracker * parent )

Member Function Documentation

◆ addChild()

void Catch::TestCaseTracking::TrackerBase::addChild ( ITrackerPtr const & child)
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 90 of file catch_test_case_tracker.cpp.

90 {
91 m_children.push_back( child );
92 }

◆ close()

void Catch::TestCaseTracking::TrackerBase::close ( )
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 128 of file catch_test_case_tracker.cpp.

128 {
129
130 // Close any still open children (e.g. generators)
131 while( &m_ctx.currentTracker() != this )
133
134 switch( m_runState ) {
135 case NeedsAnotherRun:
136 break;
137
138 case Executing:
140 break;
142 if( m_children.empty() || m_children.back()->isComplete() )
144 break;
145
146 case NotStarted:
148 case Failed:
149 CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState );
150
151 default:
152 CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState );
153 }
154 moveToParent();
156 }
#define CATCH_INTERNAL_ERROR(msg)
Here is the call graph for this function:

◆ fail()

void Catch::TestCaseTracking::TrackerBase::fail ( )
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 157 of file catch_test_case_tracker.cpp.

157 {
159 if( m_parent )
161 moveToParent();
163 }
virtual void markAsNeedingAnotherRun()=0
Here is the call graph for this function:

◆ findChild()

ITrackerPtr Catch::TestCaseTracking::TrackerBase::findChild ( NameAndLocation const & nameAndLocation)
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 94 of file catch_test_case_tracker.cpp.

94 {
95 auto it = std::find_if( m_children.begin(), m_children.end(),
96 [&nameAndLocation]( ITrackerPtr const& tracker ){
97 return
98 tracker->nameAndLocation().location == nameAndLocation.location &&
99 tracker->nameAndLocation().name == nameAndLocation.name;
100 } );
101 return( it != m_children.end() )
102 ? *it
103 : nullptr;
104 }
std::shared_ptr< ITracker > ITrackerPtr
Here is the call graph for this function:

◆ hasChildren()

bool Catch::TestCaseTracking::TrackerBase::hasChildren ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 85 of file catch_test_case_tracker.cpp.

85 {
86 return !m_children.empty();
87 }

◆ isComplete()

bool Catch::TestCaseTracking::TrackerBase::isComplete ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 76 of file catch_test_case_tracker.cpp.

76 {
78 }
Here is the caller graph for this function:

◆ isGeneratorTracker()

bool Catch::TestCaseTracking::TrackerBase::isGeneratorTracker ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 119 of file catch_test_case_tracker.cpp.

119{ return false; }

◆ isOpen()

bool Catch::TestCaseTracking::TrackerBase::isOpen ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 82 of file catch_test_case_tracker.cpp.

82 {
83 return m_runState != NotStarted && !isComplete();
84 }
Here is the call graph for this function:

◆ isSectionTracker()

bool Catch::TestCaseTracking::TrackerBase::isSectionTracker ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 118 of file catch_test_case_tracker.cpp.

118{ return false; }

◆ isSuccessfullyCompleted()

bool Catch::TestCaseTracking::TrackerBase::isSuccessfullyCompleted ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 79 of file catch_test_case_tracker.cpp.

79 {
81 }

◆ markAsNeedingAnotherRun()

void Catch::TestCaseTracking::TrackerBase::markAsNeedingAnotherRun ( )
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 164 of file catch_test_case_tracker.cpp.

164 {
166 }

◆ nameAndLocation()

NameAndLocation const & Catch::TestCaseTracking::TrackerBase::nameAndLocation ( ) const
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 73 of file catch_test_case_tracker.cpp.

73 {
74 return m_nameAndLocation;
75 }
Here is the caller graph for this function:

◆ open()

void Catch::TestCaseTracking::TrackerBase::open ( )

Definition at line 121 of file catch_test_case_tracker.cpp.

121 {
123 moveToThis();
124 if( m_parent )
126 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openChild()

void Catch::TestCaseTracking::TrackerBase::openChild ( )
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 110 of file catch_test_case_tracker.cpp.

110 {
113 if( m_parent )
115 }
116 }
Here is the call graph for this function:

◆ parent()

ITracker & Catch::TestCaseTracking::TrackerBase::parent ( )
overridevirtual

Implements Catch::TestCaseTracking::ITracker.

Definition at line 105 of file catch_test_case_tracker.cpp.

105 {
106 assert( m_parent ); // Should always be non-null except for root
107 return *m_parent;
108 }

Member Data Documentation

◆ m_children

Children Catch::TestCaseTracking::TrackerBase::m_children
protected

Definition at line 100 of file catch_test_case_tracker.h.

◆ m_ctx

TrackerContext& Catch::TestCaseTracking::TrackerBase::m_ctx
protected

Definition at line 98 of file catch_test_case_tracker.h.

◆ m_nameAndLocation

NameAndLocation Catch::TestCaseTracking::TrackerBase::m_nameAndLocation
protected

Definition at line 97 of file catch_test_case_tracker.h.

◆ m_parent

ITracker* Catch::TestCaseTracking::TrackerBase::m_parent
protected

Definition at line 99 of file catch_test_case_tracker.h.

◆ m_runState

CycleState Catch::TestCaseTracking::TrackerBase::m_runState = NotStarted
protected

Definition at line 101 of file catch_test_case_tracker.h.


The documentation for this class was generated from the following files: