Skip to content
Welcome to the new CppUtils documentation!

Namespace: CppUtils::UnitTest::JUnit

auto generateXml(std::span<const RecordedTestSuite> suites, std::string_view runName="CppUtils Unit Tests", std::chrono::nanoseconds totalDuration={}) -> std::string;

Generates a standard JUnit XML document string from structured test run data.

ParameterDescription
suitesSpan of recorded test suites.
runNameTest run suite name attribute (defaults to “CppUtils Unit Tests”).
totalDurationTotal wall-clock duration of the test run.

Returns: Formatted XML document.

auto writeJUnitXmlReport(const std::filesystem::path& filePath, std::span<const RecordedTestSuite> suites, std::chrono::nanoseconds totalDuration={}) -> void;

Serializes test execution results to a standard JUnit XML report file.

ParameterDescription
filePathOutput file destination path.
suitesSpan of recorded test suites with their test cases and execution metrics.
totalDurationTotal wall-clock duration of the test run.