微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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个或更多谷歌测试结果.如果说实话那是最主要的目标.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。