mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Remove obsolete IndexTracker
This commit is contained in:
		| @@ -238,55 +238,11 @@ namespace TestCaseTracking { | ||||
|             m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); | ||||
|     } | ||||
|  | ||||
|     IndexTracker::IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ) | ||||
|     :   TrackerBase( nameAndLocation, ctx, parent ), | ||||
|         m_size( size ) | ||||
|     {} | ||||
|  | ||||
|     bool IndexTracker::isIndexTracker() const { return true; } | ||||
|  | ||||
|     IndexTracker& IndexTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ) { | ||||
|         std::shared_ptr<IndexTracker> tracker; | ||||
|  | ||||
|         ITracker& currentTracker = ctx.currentTracker(); | ||||
|         if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { | ||||
|             assert( childTracker ); | ||||
|             assert( childTracker->isIndexTracker() ); | ||||
|             tracker = std::static_pointer_cast<IndexTracker>( childTracker ); | ||||
|         } | ||||
|         else { | ||||
|             tracker = std::make_shared<IndexTracker>( nameAndLocation, ctx, ¤tTracker, size ); | ||||
|             currentTracker.addChild( tracker ); | ||||
|         } | ||||
|  | ||||
|         if( !ctx.completedCycle() && !tracker->isComplete() ) { | ||||
|             if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) | ||||
|                 tracker->moveNext(); | ||||
|             tracker->open(); | ||||
|         } | ||||
|  | ||||
|         return *tracker; | ||||
|     } | ||||
|  | ||||
|     int IndexTracker::index() const { return m_index; } | ||||
|  | ||||
|     void IndexTracker::moveNext() { | ||||
|         m_index++; | ||||
|         m_children.clear(); | ||||
|     } | ||||
|  | ||||
|     void IndexTracker::close() { | ||||
|         TrackerBase::close(); | ||||
|         if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) | ||||
|             m_runState = Executing; | ||||
|     } | ||||
|  | ||||
| } // namespace TestCaseTracking | ||||
|  | ||||
| using TestCaseTracking::ITracker; | ||||
| using TestCaseTracking::TrackerContext; | ||||
| using TestCaseTracking::SectionTracker; | ||||
| using TestCaseTracking::IndexTracker; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
|   | ||||
| @@ -150,28 +150,11 @@ namespace TestCaseTracking { | ||||
|         void addNextFilters( std::vector<std::string> const& filters ); | ||||
|     }; | ||||
|  | ||||
|     class IndexTracker : public TrackerBase { | ||||
|         int m_size; | ||||
|         int m_index = -1; | ||||
|     public: | ||||
|         IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ); | ||||
|  | ||||
|         bool isIndexTracker() const override; | ||||
|         void close() override; | ||||
|  | ||||
|         static IndexTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ); | ||||
|  | ||||
|         int index() const; | ||||
|  | ||||
|         void moveNext(); | ||||
|     }; | ||||
|  | ||||
| } // namespace TestCaseTracking | ||||
|  | ||||
| using TestCaseTracking::ITracker; | ||||
| using TestCaseTracking::TrackerContext; | ||||
| using TestCaseTracking::SectionTracker; | ||||
| using TestCaseTracking::IndexTracker; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský