First cut of StaticRegistries - separate from Context

This commit is contained in:
Phil Nash 2012-08-06 20:16:53 +01:00
parent 5234b15ff4
commit 1091ca81e6
21 changed files with 222 additions and 141 deletions

View file

@ -80,7 +80,7 @@ namespace Catch {
virtual void runAll( bool runHiddenTests = false ) {
m_reporter->StartGroup( "" );
const std::vector<TestCaseInfo>& allTests = getCurrentContext().getTestCaseRegistry().getAllTests();
const std::vector<TestCaseInfo>& allTests = getStatics().getTestCaseRegistry().getAllTests();
for( std::size_t i=0; i < allTests.size(); ++i ) {
if( runHiddenTests || !allTests[i].isHidden() ) {
if( aborting() ) {
@ -100,7 +100,7 @@ namespace Catch {
TestSpec testSpec( rawTestSpec );
const std::vector<TestCaseInfo>& allTests = getCurrentContext().getTestCaseRegistry().getAllTests();
const std::vector<TestCaseInfo>& allTests = getStatics().getTestCaseRegistry().getAllTests();
std::size_t testsRun = 0;
for( std::size_t i=0; i < allTests.size(); ++i ) {
if( testSpec.matches( allTests[i].getName() ) ) {
@ -282,7 +282,7 @@ namespace Catch {
// This just means the test was aborted due to failure
}
catch(...) {
acceptMessage( getCurrentContext().getExceptionTranslatorRegistry().translateActiveException() );
acceptMessage( getStatics().getExceptionTranslatorRegistry().translateActiveException() );
acceptResult( ResultWas::ThrewException );
}
m_info.clear();