From 5b15c21c9ccccb3a620f6f8de5eaf097ad74e58b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 12 Jun 2013 19:05:21 +0100 Subject: [PATCH] Fixed iTChRunner --- .gitignore | 1 + .../iTchRunner/internal/iTchRunnerMainView.h | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 986f75d1..569f38d8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ projects/XCode4/iOSTest/Build projects/XCode4/CatchSelfTest/DerivedData projects/XCode4/OCTest/DerivedData *.pyc +projects/XCode4/iOSTest/DerivedData diff --git a/projects/runners/iTchRunner/internal/iTchRunnerMainView.h b/projects/runners/iTchRunner/internal/iTchRunnerMainView.h index 5cc8802b..f63fbb0f 100644 --- a/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +++ b/projects/runners/iTchRunner/internal/iTchRunnerMainView.h @@ -77,7 +77,7 @@ // This is a copy & paste from Catch::Runner2 to get us bootstrapped (this is due to all be // replaced anyway) -inline Catch::Totals runTestsForGroup( Catch::Runner& context, const Catch::TestCaseFilters& filterGroup ) { +inline Catch::Totals runTestsForGroup( Catch::RunContext& context, const Catch::TestCaseFilters& filterGroup ) { using namespace Catch; Totals totals; std::vector::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin(); @@ -102,10 +102,10 @@ inline Catch::Totals runTestsForGroup( Catch::Runner& context, const Catch::Test /////////////////////////////////////////////////////////////////////////////// -(void) actionSheet: (UIActionSheet*) sheet clickedButtonAtIndex: (NSInteger) index { - Catch::Config config; + Catch::Ptr config = new Catch::Config(); Catch::IReporter* reporter = new Catch::iTchRunnerReporter( self ); - Catch::LegacyReporterAdapter* reporterAdapter = new Catch::LegacyReporterAdapter( reporter, Catch::ReporterConfig( config.stream(), config.data() ) ); - Catch::Runner runner( config, reporterAdapter ); + Catch::LegacyReporterAdapter* reporterAdapter = new Catch::LegacyReporterAdapter( reporter ); + Catch::RunContext runner( config.get(), reporterAdapter ); std::vector filterGroups; @@ -117,10 +117,12 @@ inline Catch::Totals runTestsForGroup( Catch::Runner& context, const Catch::Test std::vector::const_iterator it = filterGroups.begin(); std::vector::const_iterator itEnd = filterGroups.end(); - for(; it != itEnd && !runner.aborting(); ++it ) { - runner.testGroupStarting( it->getName() ); + std::size_t groupCount = filterGroups.size(); + std::size_t groupIndex = 0; + for(; it != itEnd && !runner.aborting(); ++it, ++index ) { + runner.testGroupStarting( it->getName(), groupIndex, groupCount ); totals += runTestsForGroup( runner, *it ); - runner.testGroupEnded( it->getName(), totals ); + runner.testGroupEnded( it->getName(), totals, groupIndex, groupCount ); }