FatalErrorConditions now full close reporter states

- so the console reporter(s) show final summary and the xml reporters close their tags
This commit is contained in:
Phil Nash 2014-08-22 19:33:28 +01:00
parent cb8fe472b2
commit 05743eeaa1
3 changed files with 54 additions and 22 deletions

View file

@ -16,11 +16,8 @@ namespace Catch {
inline void fatal( std::string const& message, int exitCode ) {
IContext& context = Catch::getCurrentContext();
IResultCapture* resultCapture = context.getResultCapture();
ResultBuilder resultBuilder = resultCapture->makeUnexpectedResultBuilder();
resultBuilder.setResultType( ResultWas::FatalErrorCondition );
resultBuilder << message;
resultBuilder.captureExpression();
resultCapture->handleFatalErrorCondition( message );
if( Catch::alwaysTrue() ) // avoids "no return" warnings
exit( exitCode );
}