delphi – 在hudson中的dunit测试结果消息

前端之家收集整理的这篇文章主要介绍了delphi – 在hudson中的dunit测试结果消息前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用 Hudson作为Delphi 2010项目的CI服务器. XMLTestRunner.pas单元将DUnit测试结果写入xml文件,该文件由hudson xUnit插件用于报告测试结果. xUnit插件显示失败但没有消息:
  1. Stacktrace
  2.  
  3. MESSAGE:
  4.  
  5. +++++++++++++++++++
  6. STACK TRACE:

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

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

在哈德森配置中还有一个“自定义工具”选项,我必须指定“自定义样式表”,但我不知道如何编写这样的样式表(有没有任何文档?).

在我的带有升压测试的C项目中,可以很好地报告所有消息的失败情况.

解决方法

我不得不更改XMLListener以使其与hudson一起使用,因为失败的XML结构必须如下所示:
  1. <testcase name="GetFreeDirNameTest" classname="Test.exe.MyFiles.TTests" result="Failed" time="0.000">
  2. <failure message="Expected:
  3. &#34;-1&#34;
  4. But was:
  5. &#34;0&#34;" type="Failed">GetFreeDirNameTest: Expected:
  6. &#34;-1&#34;
  7. But was:
  8. &#34;0&#34;
  9. </failure>
  10. </testcase>

猜你在找的Delphi相关文章