Skip to content

Commit

Permalink
Add lineinfo to XML reporter output for INFO/WARN
Browse files Browse the repository at this point in the history
Closes #1251
  • Loading branch information
horenmar committed Apr 10, 2023
1 parent 50bf00e commit fb806da
Show file tree
Hide file tree
Showing 3 changed files with 478 additions and 476 deletions.
10 changes: 6 additions & 4 deletions src/catch2/reporters/catch_reporter_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ namespace Catch {
// Print any info messages in <Info> tags.
for( auto const& msg : assertionStats.infoMessages ) {
if( msg.type == ResultWas::Info && includeResults ) {
m_xml.scopedElement( "Info" )
.writeText( msg.message );
auto t = m_xml.scopedElement( "Info" );
writeSourceInfo( msg.lineInfo );
t.writeText( msg.message );
} else if ( msg.type == ResultWas::Warning ) {
m_xml.scopedElement( "Warning" )
.writeText( msg.message );
auto t = m_xml.scopedElement( "Warning" );
writeSourceInfo( msg.lineInfo );
t.writeText( msg.message );
}
}
}
Expand Down

0 comments on commit fb806da

Please sign in to comment.