1.2 KiB
layout | title | tags | created | ||||
---|---|---|---|---|---|---|---|
post | Using Glib's gtester Results in Hudson |
|
1245312122 |
For one of the projects I've been working on lately, I've been making use of Glib's Testing functionality to write unit tests for a C-based project. I'm a fairly big fan of the Hudson Continuous Integration Server and I wanted to run tests for my C-based project.
Unfortunately, the gtester
application generates XML in a custom format that Hudson cannot understand (i.e. JUnit formatted XML). In order to come up with some JUnit XML, I spent about an hour and a half toying with XSLT for transforming the XML gtester
generates (see the snippet below).
I added a shell script build step to the end of the build process that runs:
gtester test_app --keep-going -o=Tests.xml
xsltproc -o tests.junit.xml gtester.xsl Tests.xml
Then I just specified "tests.junit.xml" in the Publish JUnit test result report section of the Post-build Actions and then Hudson would properly process and post the test results when the job was finished.