From f2dc9dbb2d3879f90eccf84ee117def9e52c9586 Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Thu, 2 May 2024 13:58:14 +0200 Subject: [PATCH] Add measurement samples to xml reporter --- src/catch2/reporters/catch_reporter_xml.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/catch2/reporters/catch_reporter_xml.cpp b/src/catch2/reporters/catch_reporter_xml.cpp index 35a3028e..38f5206e 100644 --- a/src/catch2/reporters/catch_reporter_xml.cpp +++ b/src/catch2/reporters/catch_reporter_xml.cpp @@ -250,6 +250,12 @@ namespace Catch { .writeAttribute("lowSevere"_sr, benchmarkStats.outliers.low_severe) .writeAttribute("highMild"_sr, benchmarkStats.outliers.high_mild) .writeAttribute("highSevere"_sr, benchmarkStats.outliers.high_severe); + auto samples = m_xml.scopedElement("samples"); + for (auto const& sample : benchmarkStats.samples) { + m_xml.startElement("sample", XmlFormatting::Indent) + .writeText(std::to_string(sample.count()), XmlFormatting::None) + .endElement(XmlFormatting::Newline); + } m_xml.endElement(); }