Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dunit test result messages in hudson

i am using Hudson as CI server for Delphi 2010 projects. The XMLTestRunner.pas unit writes DUnit test result to a xml file that is used by the hudson xUnit plugin to report test results. The xUnit plugin shows failures but no messages:

Stacktrace

MESSAGE:

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

In the hudson project configuration at "Publish testing tools result report" i choose "NUnit-Version N/A (default)" as tesing tool, because there is no dunit option in the list and the xml files looks similar to 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: &lt; hello world! &gt; but was: &lt; hallo welt &gt;</message>
</test-case>
...

In the hudson configuration there is also an "Custom Tool" option, where i have to specify a "Custom stylesheet", but i don't know how to write such a stylesheet (is there any documentation?).

On my C++ projets with boost test, the failures are reported nicely with all messages.

like image 957
hansmaad Avatar asked Dec 20 '10 09:12

hansmaad


2 Answers

I had to change the XMLListener to get it work with hudson because the XML structure of a failure had to look like this:

<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>
like image 89
Matthias Alleweldt Avatar answered Sep 27 '22 23:09

Matthias Alleweldt


What about using XMLTestRunner for NUnit compatible output from DUnit?

like image 21
Dr.eel Avatar answered Sep 27 '22 22:09

Dr.eel