19# pragma clang diagnostic push
20# pragma clang diagnostic ignored "-Wexit-time-destructors"
24namespace TestCaseTracking {
37 m_currentTracker =
nullptr;
38 m_runState = Executing;
39 return *m_rootTracker;
43 m_rootTracker.reset();
44 m_currentTracker =
nullptr;
45 m_runState = NotStarted;
49 m_currentTracker = m_rootTracker.get();
50 m_runState = Executing;
53 m_runState = CompletedCycle;
57 return m_runState == CompletedCycle;
60 return *m_currentTracker;
63 m_currentTracker = tracker;
68 : m_nameAndLocation( nameAndLocation ),
98 tracker->nameAndLocation().location == nameAndLocation.location &&
99 tracker->nameAndLocation().name == nameAndLocation.name;
168 void TrackerBase::moveToParent() {
172 void TrackerBase::moveToThis() {
180 while( !parent->isSectionTracker() )
181 parent = &parent->parent();
189 bool complete =
true;
191 if ((m_filters.empty() || m_filters[0] ==
"") ||
192 std::find(m_filters.begin(), m_filters.end(),
202 std::shared_ptr<SectionTracker> section;
206 assert( childTracker );
207 assert( childTracker->isSectionTracker() );
208 section = std::static_pointer_cast<SectionTracker>( childTracker );
211 section = std::make_shared<SectionTracker>(
nameAndLocation, ctx, ¤tTracker );
225 if( !filters.empty() ) {
226 m_filters.push_back(
"");
227 m_filters.push_back(
"");
228 m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
232 if( filters.size() > 1 )
233 m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() );
244#if defined(__clang__)
245# pragma clang diagnostic pop
#define CATCH_INTERNAL_LINEINFO
#define CATCH_INTERNAL_ERROR(msg)
void addNextFilters(std::vector< std::string > const &filters)
void addInitialFilters(std::vector< std::string > const &filters)
static SectionTracker & acquire(TrackerContext &ctx, NameAndLocation const &nameAndLocation)
bool isSectionTracker() const override
bool isComplete() const override
SectionTracker(NameAndLocation const &nameAndLocation, TrackerContext &ctx, ITracker *parent)
ITrackerPtr findChild(NameAndLocation const &nameAndLocation) override
bool isGeneratorTracker() const override
NameAndLocation m_nameAndLocation
void markAsNeedingAnotherRun() override
bool isComplete() const override
void addChild(ITrackerPtr const &child) override
bool isSectionTracker() const override
NameAndLocation const & nameAndLocation() const override
bool isSuccessfullyCompleted() const override
TrackerBase(NameAndLocation const &nameAndLocation, TrackerContext &ctx, ITracker *parent)
bool isOpen() const override
ITracker & parent() override
bool hasChildren() const override
void openChild() override
void setCurrentTracker(ITracker *tracker)
ITracker & currentTracker()
bool completedCycle() const
std::shared_ptr< ITracker > ITrackerPtr
virtual void markAsNeedingAnotherRun()=0
virtual ITrackerPtr findChild(NameAndLocation const &nameAndLocation)=0
virtual void openChild()=0
virtual void addChild(ITrackerPtr const &child)=0
NameAndLocation(std::string const &_name, SourceLineInfo const &_location)