加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 23:06:14 所属栏目:百科 来源:网络整理
导读:我尝试使用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 prod
我尝试使用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个或更多谷歌测试结果.如果说实话那是最主要的目标.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读