哈德森的Dunit测试结果消息
-
11-10-2019 - |
题
我在用 哈德森 作为Delphi 2010项目的CI服务器。 XMLTESTRUNNER.PAS单元将DUNIT测试结果写入Hudson Xunit插件用于报告测试结果的XML文件。 Xunit插件显示故障,但没有消息:
Stacktrace
MESSAGE:
+++++++++++++++++++
STACK TRACE:
在“发布测试工具结果报告”中的Hudson Project配置中,我选择“ Nunit-version n/a(默认)”作为tesing工具,因为列表中没有Dunit选项,XML文件看起来与Nunit Format相似:
<?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: < hello world! > but was: < hallo welt ></message>
</test-case>
...
在哈德逊配置中,还有一个“自定义工具”选项,我必须在其中指定“自定义样式表”,但是我不知道如何编写这样的样式表(是否有任何文档?)。
在我的C ++ Projets和Boost测试中,所有消息都很好地报告了故障。
解决方案
我必须更改Xmllistener才能与Hudson一起工作,因为失败的XML结构必须看起来像这样:
<testcase name="GetFreeDirNameTest" classname="Test.exe.MyFiles.TTests" result="failed" time="0.000">
<failure message="Expected:
"-1"
But was:
"0"" type="failed">GetFreeDirNameTest: Expected:
"-1"
But was:
"0"
</failure>
</testcase>
其他提示
不隶属于 StackOverflow