| 14455 | } |
| 14456 | |
| 14457 | void TrackerBase::close() { |
| 14458 | |
| 14459 | // Close any still open children (e.g. generators) |
| 14460 | while( &m_ctx.currentTracker() != this ) |
| 14461 | m_ctx.currentTracker().close(); |
| 14462 | |
| 14463 | switch( m_runState ) { |
| 14464 | case NeedsAnotherRun: |
| 14465 | break; |
| 14466 | |
| 14467 | case Executing: |
| 14468 | m_runState = CompletedSuccessfully; |
| 14469 | break; |
| 14470 | case ExecutingChildren: |
| 14471 | if( std::all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) ) |
| 14472 | m_runState = CompletedSuccessfully; |
| 14473 | break; |
| 14474 | |
| 14475 | case NotStarted: |
| 14476 | case CompletedSuccessfully: |
| 14477 | case Failed: |
| 14478 | CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState ); |
| 14479 | |
| 14480 | default: |
| 14481 | CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState ); |
| 14482 | } |
| 14483 | moveToParent(); |
| 14484 | m_ctx.completeCycle(); |
| 14485 | } |
| 14486 | void TrackerBase::fail() { |
| 14487 | m_runState = Failed; |
| 14488 | if( m_parent ) |
no test coverage detected