Skip to content

Commit

Permalink
Remove obsolete IndexTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jan 29, 2019
1 parent 61f4c7a commit 64a9c02
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 1,222 deletions.
44 changes: 0 additions & 44 deletions include/internal/catch_test_case_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, &currentTracker, 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

Expand Down
17 changes: 0 additions & 17 deletions include/internal/catch_test_case_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
63 changes: 0 additions & 63 deletions projects/SelfTest/Baselines/compact.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1034,69 +1034,6 @@ PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0
PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase.isSuccessfullyCompleted() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.index() == 1 for: 1 == 1
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0
PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s2.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.index() == 1 for: 1 == 1
PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s2b.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1.index() == 0 for: 0 == 0
PartTracker.tests.cpp:<line number>: passed: g1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s2.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s2.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: s2.isSuccessfullyCompleted() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase2.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1b.index() == 0 for: 0 == 0
PartTracker.tests.cpp:<line number>: passed: s2b.isOpen() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: g1b.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: s1b.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase2.isComplete() == false for: false == false
PartTracker.tests.cpp:<line number>: passed: testCase3.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s1c.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1c.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: g1c.index() == 1 for: 1 == 1
PartTracker.tests.cpp:<line number>: passed: s2c.isOpen() for: true
PartTracker.tests.cpp:<line number>: passed: s2c.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: g1c.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: s1c.isComplete() for: true
PartTracker.tests.cpp:<line number>: passed: testCase3.isComplete() for: true
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14'
Approx.tests.cpp:<line number>: passed: d == approx( 1.23 ) for: 1.23 == Approx( 1.23 )
Approx.tests.cpp:<line number>: passed: d == approx( 1.22 ) for: 1.23 == Approx( 1.22 )
Expand Down
2 changes: 1 addition & 1 deletion projects/SelfTest/Baselines/console.std.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1171,5 +1171,5 @@ due to unexpected exception with message:

===============================================================================
test cases: 243 | 183 passed | 56 failed | 4 failed as expected
assertions: 1325 | 1189 passed | 115 failed | 21 failed as expected
assertions: 1262 | 1126 passed | 115 failed | 21 failed as expected

Loading

0 comments on commit 64a9c02

Please sign in to comment.