首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >hudson中的dunit测试结果消息

hudson中的dunit测试结果消息
EN

Stack Overflow用户
提问于 2010-12-20 17:09:17
回答 2查看 2.6K关注 0票数 7

我使用Hudson作为Delphi2010项目的CI服务器。XMLTestRunner.pas单元将DUnit测试结果写入xUnit插件用来报告测试结果的xml文件。xUnit插件会显示失败,但不会显示消息:

代码语言:javascript
复制
Stacktrace

MESSAGE:

+++++++++++++++++++
STACK TRACE:

在“发布测试工具结果报告”的hudson项目配置中,我选择“nunit -版本N/A (默认)”作为测试工具,因为列表中没有dunit选项,并且xml文件看起来类似于nunit格式:

代码语言:javascript
复制
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<test-results total="123" notrun="0" date="20.12.2010" time="09:19:24">
<test-suite name="HelloWorldTestSuite" total="46" notrun="0">
<results>
<test-case name="TestCase.HelloWorldTest" execute="True" success="False" time="0,003" result="Failure">
<failure name="ETestFailure" location=""/>
<message>expected: &lt; hello world! &gt; but was: &lt; hallo welt &gt;</message>
</test-case>
...

在hudson配置中还有一个"Custom Tool“选项,我必须指定一个"Custom stylesheet",但我不知道如何编写这样的样式表(有没有文档?)。

在我的C++ projets with boost测试中,所有消息都很好地报告了失败。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-04-15 20:49:49

我必须更改XMLListener才能使其与hudson一起工作,因为失败的XML结构必须如下所示:

代码语言:javascript
复制
<testcase name="GetFreeDirNameTest" classname="Test.exe.MyFiles.TTests" result="failed" time="0.000">
  <failure message="Expected:
        &#34;-1&#34;
        But was:
        &#34;0&#34;" type="failed">GetFreeDirNameTest: Expected:
        &#34;-1&#34;
        But was:
        &#34;0&#34;
  </failure>
</testcase>
票数 4
EN

Stack Overflow用户

发布于 2013-11-21 17:19:45

使用XMLTestRunner for NUnit compatible output from DUnit怎么样?

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4488203

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档