[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test results as XML files

On Mon, 2014-06-23 at 18:11 +0200, Krzysztof Tomasz Lebioda wrote:
> Hi,

Andreas is on vacation until the end of the month, I hope he wouldn't
mind me replying :-)

> I am trying to find an appropriate unit testing framework for our 
> project. I find the cmocka with it's mocking capabilities to be very 
> promising. I wrote some tests and I really like the concept. There is 
> one thing that I would like to ask about, though.
> We would like to run our unit tests as a part of the nightly build. 
> Continuous integration tools, like Jenkins or Bamboo (which we use), 
> often offer test result reporting and error highlighting. For this they 
> should be supplied with some XML files which contain the test results. 
>  From what I know, the JUnit format is supported out of the box, at 
> least by the two continuous integration tools mentioned before.

In general, this would have to be done without any additional
dependency, like a XML library, because one of the goals of cmocka is
"requires nothing more than a C library".

Then there is the choice of the XML schema. I admit I don't know the
JUnit schema or the others -- do you know what other schemas are in wide
use? Can you send a link to the JUnit schema specification? I only found
links like:

From coding standpoint, we'd have to modify how print_error works.
Currently it's used to print both "progress information" and info about
the test cases themselves.

> It would be really nice if cmocka could create XML reports using some 
> well-known format (like JUnit). The framework would be complete then. Do 
> you plan to add such functionality? Maybe there are some tools out there 
> which could parse the cmocka output and create proper XML files?

I think the cmocka output is pretty much ad-hoc. I wonder if there are
any other users who would like to see this functionality?

Maybe writing a custom script to parse the output and feed it into XML,
using some higher level language like Python would be easier, at least
for the short term?

Test results as XML filesKrzysztof Tomasz Lebioda <klebioda@xxxxxxx>