JUnit XML 输出规范

在哪里可以找到 JUnit 的 XML 输出的规范。 我的目标是编写一个 UnitTest + + XML 报告程序,生成类似 JUnit 的输出。

看: “ 无法让 Hudson 解析 JUnit 测试输出 XML”和“ Hudson,C + + 和 UnitTest + +

98596 次浏览

I can only give you an general information.

In the sourcecode of JUnit, you will find your information. If you provide some more information, I can help you further. My personal hint for finding your specification would be junit.framework.TestResult.

Good luck!

The xml output is not generated by JUnit (at least, not the junit.jar), but by the junit ant task.
The relevant class is org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.

As others have mentioned the xml is handled by ANT not jUnit

Here's the best spec I've seen. From this post

You can find an XSD based on the code in Apache Ant 1.8.2 at https://github.com/windyroad/JUnit-Schema