diff options
| author | Martin Hořeňovský | 2023-04-10 16:32:03 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-04-10 16:32:07 +0200 |
| commit | fb806da76f9b9fdeecd5d09269f03e6a7c5175e7 (patch) | |
| tree | 7a40c8ce147e4f65b98faf935b5013d0ea7b3688 /src/catch2 | |
| parent | 50bf00e266b32531385c9098f2676875c0aa8ac2 (diff) | |
| download | catch3-fb806da76f9b9fdeecd5d09269f03e6a7c5175e7.tar.gz | |
Add lineinfo to XML reporter output for INFO/WARN
Closes #1251
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_xml.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/catch2/reporters/catch_reporter_xml.cpp b/src/catch2/reporters/catch_reporter_xml.cpp index 13812b92..d90295bb 100644 --- a/src/catch2/reporters/catch_reporter_xml.cpp +++ b/src/catch2/reporters/catch_reporter_xml.cpp @@ -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 ); } } } |