converting TAP output to JUnit-style XML

Here’s a perl script that may prove useful: tap-to-junit-xml

NAME

tap-to-junit-xml - convert perl-style TAP test output to JUnit-style XML

SYNOPSIS

tap-to-junit-xml "test suite name" [ outputprefix ] < tap_output.log

DESCRIPTION

Parse test suite output in TAP (Test Anything Protocol) format, and produce XML output in a similar format to that produced by the <junit> ant task. This is useful for consumption by continuous-integration systems like Hudson.

Written in perl, requires TAP::Parser and XML::Generator. It’s based on junit_xml.pl by Matisse Enzer, although pretty much entirely rewritten.

Tags: , , , , , , ,

2 Comments »

  1. Pavel Topinka said,

    April 9, 2008 @ 8:49 am

    Hello I tried this script and it works fine. I have question about integration with Hudson. How can hudson realize that test fails ? Do you run your perl test from ANT? Thank you Pavel

  2. Justin said,

    April 9, 2008 @ 9:19 am

    In my Hudson configuration, I run the perl tests like this:

        make test TEST_VERBOSE=1 2>&1 | tee make_test.log
        tap-to-junit-xml "make test" testxml/make_test < make_test.log
    

    And then I have Hudson set up to read the JUnit-formatted XML from “testxml/**.xml”.

RSS feed for comments on this post

Leave a Comment

Comment text formatting: Markdown Extra syntax is supported, as is plain old HTML. (Quick reference for Markdown basics)

View blog reactions using Technorati