mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 13:55:39 +02:00
Specialize XML reporter's listener listing
This commit is contained in:
@@ -259,6 +259,19 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void XmlReporter::listListeners(std::vector<ListenerDescription> const& descriptions) {
|
||||
auto outerTag = m_xml.scopedElement( "RegisteredListeners" );
|
||||
for ( auto const& listener : descriptions ) {
|
||||
auto inner = m_xml.scopedElement( "Listener" );
|
||||
m_xml.startElement( "Name", XmlFormatting::Indent )
|
||||
.writeText( listener.name, XmlFormatting::None )
|
||||
.endElement( XmlFormatting::Newline );
|
||||
m_xml.startElement( "Description", XmlFormatting::Indent )
|
||||
.writeText( listener.description, XmlFormatting::None )
|
||||
.endElement( XmlFormatting::Newline );
|
||||
}
|
||||
}
|
||||
|
||||
void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests) {
|
||||
auto outerTag = m_xml.scopedElement("MatchingTests");
|
||||
for (auto const& test : tests) {
|
||||
|
@@ -51,6 +51,7 @@ namespace Catch {
|
||||
void benchmarkFailed( StringRef error ) override;
|
||||
|
||||
void listReporters(std::vector<ReporterDescription> const& descriptions) override;
|
||||
void listListeners(std::vector<ListenerDescription> const& descriptions) override;
|
||||
void listTests(std::vector<TestCaseHandle> const& tests) override;
|
||||
void listTags(std::vector<TagInfo> const& tags) override;
|
||||
|
||||
|
Reference in New Issue
Block a user