mirror of https://github.com/catchorg/Catch2.git
Move std::exception_ptr out of interfaces
This commit is contained in:
parent
307eeefa8f
commit
446bad752f
|
@ -46,7 +46,7 @@ namespace Catch {
|
||||||
virtual void registerTest( TestCase const& testInfo ) = 0;
|
virtual void registerTest( TestCase const& testInfo ) = 0;
|
||||||
virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
|
virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
|
||||||
virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
|
virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
|
||||||
virtual void registerStartupException( std::exception_ptr const& exception ) noexcept = 0;
|
virtual void registerStartupException() noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
IRegistryHub& getRegistryHub();
|
IRegistryHub& getRegistryHub();
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace Catch {
|
||||||
void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
|
void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
|
||||||
m_tagAliasRegistry.add( alias, tag, lineInfo );
|
m_tagAliasRegistry.add( alias, tag, lineInfo );
|
||||||
}
|
}
|
||||||
void registerStartupException( std::exception_ptr const& exception ) noexcept override {
|
void registerStartupException() noexcept override {
|
||||||
m_exceptionRegistry.add(exception);
|
m_exceptionRegistry.add(std::current_exception());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Catch {
|
||||||
getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
|
getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// Do not throw when constructing global objects, instead register the exception to be processed later
|
// Do not throw when constructing global objects, instead register the exception to be processed later
|
||||||
getMutableRegistryHub().registerStartupException(std::current_exception());
|
getMutableRegistryHub().registerStartupException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Catch {
|
||||||
lineInfo));
|
lineInfo));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// Do not throw when constructing global objects, instead register the exception to be processed later
|
// Do not throw when constructing global objects, instead register the exception to be processed later
|
||||||
getMutableRegistryHub().registerStartupException( std::current_exception() );
|
getMutableRegistryHub().registerStartupException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue