TAP::F...::JUnit(3pm)
π TAP::F...::JUnit β the manual, but make it cute π
okay bestie, welcome to TAP::F...::JUnit(3pm) β yes the title is abbreviated like that in the header, it's giving β¨mysteryβ¨ β and this is a User Contributed Perl Documentation page, so you know it's community-made with love. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
TAP::Formatter::JUnit β the harness output delegate that makes JUnit output. it's the friend who translates your TAP vibes into JUnit XML, no cap π
β¨ SYNOPSIS β¨
on the command line, with prove:
$ prove --formatter TAP::Formatter::JUnit ...
or, in your own scripts:
use TAP::Harness;
# What TAP output did we save from a previous run, with
# PERL_TEST_HARNESS_DUMP_TAP=tap/
my @tests = glob("tap/*.t");
# Convert the TAP to JUnit
my $harness = TAP::Harness->new( {
formatter_class => 'TAP::Formatter::JUnit',
merge => 1,
} );
$harness->runtests(@tests);
like. look at that. she's gorgeous. π
β¨ DESCRIPTION β¨
real talk: this code is currently in alpha state and is subject to change. so don't build your whole personality on it, ok? π«Ά
TAP::Formatter::JUnit provides JUnit output formatting for TAP::Harness. that's the whole gig. iconic.
by default β like, when you run it with prove β the entire test suite gets gathered together into a single JUnit XML document, which then gets displayed on STDOUT. one big beautiful doc. β¨
BUT. you can also have individual JUnit XML files dumped for each individual test, by setting PERL_TEST_HARNESS_DUMP_TAP to a directory you want the JUnit XML dumped to. heads up though: doing that will also cause TAP::Harness to dump the original TAP output into that directory too. and honestly? IMHO that's ok, because now you've got the data in two parseable formats. slay. two formats, zero regrets. π
timing information is included in the JUnit XML β but only if you specified --timer when you ran prove. no timer flag, no timing tea. β±οΈ
in standard use, a passing TODO is treated as a failure condition (and it's reported as such in the generated JUnit). if you want those to be treated as a pass and not a fail condition instead, setting ALLOW_PASSING_TODOS in your environment will turn these into pass conditions. your call, bestie. πΈ
and the JUnit output generated is partial to being grokked by Hudson (http://hudson.dev.java.net/). that's the build tool the author was using at the moment and needed to be able to generate JUnit output for. so. yeah. that's the lore. π
β¨ ATTRIBUTES β¨
testsuitesβ list-ref of test suites that have been executed. the receipts. the whole roster. πxmlβ anXML::Generatorinstance, to be used to generate XML output. she's the machine that makes the XML. π§
β¨ METHODS β¨
open_test($test, $parser)β an over-riddenopen_test()method. it creates aTAP::Formatter::JUnit::Sessionsession instead of a console formatter session. different session, different vibe. π¦summary()β prints the summary report (in JUnit) after all tests are run. the final word. the closing number. periodt. πadd_testsuite($suite)β adds the given XML test$suiteto the list of test suites that we've executed and need to summarize. adding to the pile, respectfully. β
β¨ AUTHOR β¨
Graham TerMarsch <cpan@howlingfrog.com> β absolute legend, wrote the whole thing. π
many thanks to Andy Armstrong and all those involved for the fabulous set of tests in Test::Harness; they became the basis for the unit tests here. genuinely iconic contribution, fr fr.
other thanks go out to those that have provided feedback, comments, or patches:
Mark Aufflick
Joe McMahon
Michael Nachbaur
Marc Abramowitz
Colin Robertson
Phillip Kimmey
Dave Lambley
shoutout to the whole squad. y'all ate. π½οΈβ¨
β¨ COPYRIGHT β¨
Copyright 2008-2010, Graham TerMarsch. All Rights Reserved.
this is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free as in freedom, bestie. π
β¨ SEE ALSO β¨
TAP::Formatter::ConsoleTAP::Formatter::JUnit::Session- Hudson home page β
http://hudson.dev.java.net/ JUnitXSchema.xsdβhttp://jra1mw.cvs.cern.ch:8180/cgi-bin/jra1mw.cgi/org.glite.testing.unit/config/JUnitXSchema.xsd?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD- JUnit parsing in Bamboo β
http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo.
okay that's the whole page, you made it to the end π«Ά this beauty was rendered by perl v5.40.0 and dated 2025-02-07, and yeah it's the User Contributed Perl Documentation edition. go forth and format your JUnit, main character. π β¨π
π¦ where this page comes from
- debian trixie: libtap-formatter-junit-perl 0.17-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtap-formatter-junit-perl 0.17-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtap-formatter-junit-perl 0.17-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms