编辑:此问题已由谷歌在gtest 1.4.0修复; 有关更多信息,请参阅原始错误报告.
我最近切换到gtest用于我的C++测试框架,我目前无法使用它的一个很棒的功能是能够生成JUnit样式的XML测试报告,然后可以由我们的hudson构建服务器读取.
gtest测试套件生成的XML输出看起来都是合法的:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="370" failures="0" disabled="0" errors="0" time="45.61" name="AllTests">
<testsuite name="application" tests="7" failures="0" disabled="0" errors="0" time="8.953">
<testcase name="zero_tasks_on_bootup" status="run" time="0" classname="application" />
...etc.
</testsuite>
</testsuite>
Run Code Online (Sandbox Code Playgroud)
我还尝试将JUnitReport任务添加到我的ant构建脚本中,该脚本工作正常,并生成如下所示的XML:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="370" failures="0" disabled="0" errors="0" time="45.61" name="AllTests">
<testsuite name="application" tests="7" failures="0" disabled="0" errors="0" time="8.953">
<testcase name="zero_tasks_on_bootup" status="run" time="0" classname="application" />
...etc.
</testsuite>
</testsuite>
Run Code Online (Sandbox Code Playgroud)
问题是,每当我告诉ant发布JUnit测试结果,然后将其指向原始测试结果XML或者在ant JUnitReport任务中生成的编译结果时,hudson总是抱怨在那里找不到测试结果.
我不是一个java人,所以我不知道这里发生了什么,我找不到JUnit XML应该是什么样子的例子.有人可以帮助我指出正确的方向吗?