CUnit-to-JUnit transform now on BitBucket

One of the most visited blog entries on this blog probably is my article on transforming CUnit results to JUnit results: CUnit Tests in Hudson. There I write about how to use xsltproc to transform the output of CUnit to be processed by Hudson/Jenkins.

Now, I decided to put the file on BitBucket to maybe consolidate the contributions or changes others are making. I welcome everybody to make contributions to the transform there.

The link to the BitBucket project is: https://bitbucket.org/mcdeck/cunit-to-junit

CUnit Tests in Hudson

Since I needed to parse the results of some CUnit tests in Hudson in a recent project, I came up with the following transformation which I apply to the cunit xml result file.
Hudson can then evaluate the results as if they were generated by JUnit. The same approach is basically used in the CppUnit Plugin for Hudson – which is where I got the idea.
Since I’m too lazy at the moment to write my own plugin for Hudson, I figured running xsltproc after running my tests will be good enough:

1
xsltproc-win32\xsltproc.exe --stringparam suitename testall -o testall_results.xml cunit-to-junit.xsl cunit_testall-Results.xml

To make CUnit produce XML results, you have to do something like this:

C
1
2
3
CU_set_output_filename( "cunit_testall" );
CU_list_tests_to_file();
CU_automated_run_tests();

You can download the cunit-to-junit.xsl here.

Continue reading