Skip to main content

Module junit

Module junit 

Source
Available on crate feature junit only.
Expand description

JUnit XML export for Report and MultiReport.

Conforms to the common Jenkins/Surefire JUnit XML schema. Every CheckResult becomes a <testcase>; fail verdicts get a <failure> child, skip verdicts get a <skipped/> child.

§Verdict → element mapping

VerdictXML form
Pass<testcase ... />
Warn<testcase ... /> (no child)
Fail<testcase ...><failure .../></testcase>
Skip<testcase ...><skipped/></testcase>

Warn has no native JUnit representation; it is emitted as a passing testcase. Producers that want warns surfaced as findings should use the SARIF exporter (see crate::sarif) instead. <failure> carries a type attribute derived from Severity (Error, Critical).

For a MultiReport, each constituent Report becomes one <testsuite>; the producer’s name becomes the testsuite name and the testcase classname.

Available with the junit feature.

Functions§

multi_to_junit_xml
Render multi as a JUnit XML document with one <testsuite> per constituent Report.
to_junit_xml
Render report as a JUnit XML document.