mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Ability to register line# for testing
Factored file/ line storage and formatting into common class. Used in a static registry so failure messages can be asserted to have the file/ line in.
This commit is contained in:
@@ -174,11 +174,7 @@ namespace Catch
|
||||
StartSpansLazily();
|
||||
|
||||
if( !resultInfo.getFilename().empty() )
|
||||
#ifndef __GNUG__
|
||||
m_config.stream() << resultInfo.getFilename() << "(" << resultInfo.getLine() << "): ";
|
||||
#else
|
||||
m_config.stream() << resultInfo.getFilename() << ":" << resultInfo.getLine() << ": ";
|
||||
#endif
|
||||
m_config.stream() << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() );
|
||||
|
||||
if( resultInfo.hasExpression() )
|
||||
{
|
||||
|
@@ -129,7 +129,7 @@ namespace Catch
|
||||
{
|
||||
oss << resultInfo.getMessage() << " at ";
|
||||
}
|
||||
oss << resultInfo.getFilename() << ":" << resultInfo.getLine();
|
||||
oss << SourceLineInfo( resultInfo.getFilename(), resultInfo.getLine() );
|
||||
stats.m_content = oss.str();
|
||||
stats.m_message = resultInfo.getExpandedExpression();
|
||||
stats.m_resultType = resultInfo.getTestMacroName();
|
||||
|
Reference in New Issue
Block a user