mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 23:36:11 +01:00
Merge remote-tracking branch 'tsondergaard/improve-junit-xml-for-jenkins' into dev-modernize
This commit is contained in:
commit
ebb3371cbf
@ -124,6 +124,13 @@ namespace Catch {
|
|||||||
xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false );
|
xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string fileNameTag( const std::set<std::string> &tags ) {
|
||||||
|
std::set<std::string>::const_iterator it = tags.lower_bound("#");
|
||||||
|
if( it != tags.end() && !it->empty() && it->front() == '#' )
|
||||||
|
return it->substr(1);
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
void writeTestCase( TestCaseNode const& testCaseNode ) {
|
void writeTestCase( TestCaseNode const& testCaseNode ) {
|
||||||
TestCaseStats const& stats = testCaseNode.value;
|
TestCaseStats const& stats = testCaseNode.value;
|
||||||
|
|
||||||
@ -135,9 +142,14 @@ namespace Catch {
|
|||||||
std::string className = stats.testInfo.className;
|
std::string className = stats.testInfo.className;
|
||||||
|
|
||||||
if( className.empty() ) {
|
if( className.empty() ) {
|
||||||
if( rootSection.childSections.empty() )
|
className = fileNameTag(stats.testInfo.tags);
|
||||||
|
if ( className.empty() )
|
||||||
className = "global";
|
className = "global";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !m_config->name().empty() )
|
||||||
|
className = m_config->name() + "." + className;
|
||||||
|
|
||||||
writeSection( className, "", rootSection );
|
writeSection( className, "", rootSection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user