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

前端之家收集整理的这篇文章主要介绍了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个或更多谷歌测试结果.如果说实话那是最主要的目标.

猜你在找的XML相关文章