If you already have tests using Test::More or the like, using prove --formatter TAP::Formatter::JUnit is the easiest way. You do not change any of your tests or Perl code, and you get JUnit output that uses Java tools.
We use this setting with Hudson so that we can track our tests and get good error reports if necessary from the built-in Hudson tools without a lot of distortion. Our build is based on make , but this is the only real difference from your installation.
This means that you should be able to run prove as an external task and get benefits without having to significantly change the Ant tool if this is not clear.
Depending on which Perl you installed, you may or may not have prove . Run
perl -MTest::Harness -e'print "$Test::Harness::VERSION\n"'
to find out which version you have is 3.00 or better, prove ; Ideally, you should install 3.23 to get the best functionality:
sudo cpan Test::Harness TAP::Formatter::JUnit
This installs the latest version of Test :: Harness, TAP :: Formatter :: JUnit and all the necessary prerequisites. Try an external process with
prove --formatter TAP::Formatter::JUnit your/testsuite/directory/
You should get the JUnit XML file at the end of the prove run. If all this works, add it to Ant with
<target name="run"> <exec executable="prove"> <arg value="--formatter" /> <arg value="TAP::Formatter::JUnit" /> <arg path="your/testsuite/directory/" /> </exec>
Ant documentation for "Exec"
(I believe that this is the correct Ant syntax for running an external program, but I am not an Ant expert).