googletest – 如何为gtest结果(XML文件)生成HTML报告?

我尝试使用junitreport但 XML文件内容未得到很好的识别.

@dmeister

http://code.google.com/p/googletest/issues/detail?id=114

[…] Google Test was designed to match our internal tools which expect the
XML report to match the format of those produced by the “junit” Ant
task,which has “testsuite” as the root element. […]

这就是gtest(1.6.0)生成内容

<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" failures="0" disabled="0" errors="0" time="0" name="AllTests">
    <testsuite name="SimpleTest" tests="1" failures="0" disabled="0" errors="0" time="0">
        <testcase name="Test_1" status="run" time="0" classname="SimpleTest" />
    </testsuite>
</testsuites>

这是junitreport返回的错误消息:

SimpleTest.xml is not a valid testsuite XML document

解决方法

我用Python 2做了它.*: https://github.com/burlachenkok/gtest_report

此gtest_report还支持比较2个或更多谷歌测试结果.如果说实话那是最主要的目标.

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念