TAP::Harness::JUnit - Generate JUnit compatible output from TAP results
use TAP::Harness::JUnit; my $harness = TAP::Harness::JUnit->new({ xmlfile => 'output.xml', ... }); $harness->runtests(@tests);
The only difference between this module and TAP::Harness is that this adds mandatory 'xmlfile' argument, that causes the output to be formatted into XML in format similar to one that is produced by JUnit testing framework.
This modules inherits all functions from TAP::Harness.
These options are added (compared to TAP::Harness):
Name of the file XML output will be saved to.
JUnit XML schema was obtained from http://jra1mw.cvs.cern.ch:8180/cgi-bin/jra1mw.cgi/org.glite.testing.unit/config/JUnitXSchema.xsd?view=markup.
This module was partly inspired by Michael Peters' TAP::Harness::Archive.
Test return value is ignored. This is actually not a bug, TAP::Parser doesn't present the fact and TAP specification does not require that anyway.
Note that this may be a problem when running Test::More tests with no_plan, since it will add a plan matching the number of tests actually run even in case the test dies. No not do that -- always write a plan! In case it's not possible, pass merge argument when creating a TAP::Harness::JUnit instance, and the harness will detect such failures by matching certain comments.
no_plan
merge
Test durations are always set to 0 seconds.
The comments that are above the ok or not ok are considered the output of the test. This, though being more logical, is against TAP specification.
ok
not ok
XML::Simple is used to generate the output. It is suboptimal and involves some hacks.
Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com>
<lubo.rintel@gooddata.com>
Copyright 2008 Good Data, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install TAP::Harness::JUnit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TAP::Harness::JUnit
CPAN shell
perl -MCPAN -e shell install TAP::Harness::JUnit
For more information on module installation, please visit the detailed CPAN module installation guide.