TAP::H...::JUnit(3pm)
π TAP::Harness::JUnit β the manual, but make it bestie-friendly π
okay so this page is from the User Contributed Perl Documentation for TAP::H...::JUnit(3pm) (the full name is TAP::Harness::JUnit, they just squished it in the header, iykyk). anyway bestie, let's get into it π«Ά
β¨ NAME β¨
TAP::Harness::JUnit β literally generates JUnit-compatible output from your TAP results. that's the whole vibe. π
β¨ SYNOPSIS β¨
use TAP::Harness::JUnit;
my $harness = TAP::Harness::JUnit->new({
xmlfile => 'output.xml',
package => 'database',
# ...
});
$harness->runtests(@tests);
like, that's it. that's the whole thing. slay π
β¨ DESCRIPTION β¨
so the only difference between this module and TAP::Harness is that this one adds the optional arguments 'xmlfile', 'package', and 'namemangle' β and those make the output get formatted into XML in a format similar to the one produced by the JUnit testing framework. no cap, that's the entire plot. πΈ
β¨ METHODS β¨
this module inherits all functions from TAP::Harness. all of them. every single one. π
π new
these options are added (compared to TAP::Harness):
xmlfileβ the name of the file the XML output will be saved to. if you omit this argument, the default of"junit_output.xml"is used and a warning is issued (yes, it will yell at you, lovingly). alternatively, you can specify the name of the output file in the$JUNIT_OUTPUT_FILEenvironment variable. ποΈpackageβ the Hudson/Jenkins continuous-integration systems support separating test results into "packages". by default any number of output xml files will be merged into the default package"(root)". setting a package name will place all test results from the current run into that package. you can also set the environment variable$JUNIT_PACKAGEto do the same. π¦notimes(DEPRECATED) β if provided (and true), test case times will not be recorded. it's deprecated bestie, so likeβ¦ be aware. πnamemangleβ specify how to mangle testcase names. this is sometimes required to interact with buggy JUnit consumers that lack sufficient validation (not their fault, but also kind of their fault π). alternatively, this value can be set in the environment variable$JUNIT_NAME_MANGLE.
available values are:
hudsonβ replace anything but alphanumeric characters with underscores. this is the default for historic reasons.perl(RECOMMENDED) β replace slashes in the directory hierarchy with dots so that the filesystem layout resembles a Java class hierarchy. this is the recommended setting and may become the default in future. πβ¨noneβ do not perform any transformations. zero notes. just vibes. π¦
β¨ ENVIRONMENT VARIABLES β¨
- the name of the output file can be specified in the
$JUNIT_OUTPUT_FILEenvironment variable. ποΈ - the package name that Hudson/Jenkins use to categorise test results can be specified in
$JUNIT_PACKAGE. π¦ - the name mangling mechanism used to rewrite test names can be specified in
$JUNIT_NAME_MANGLE. (see thenamemangledocumentation for available values.) π
β¨ SEE ALSO β¨
TAP::Formatter::JUnitat <https://metacpan.org/pod/TAP::Formatter::JUnit>- the 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>.
β¨ ACKNOWLEDGEMENTS β¨
this module was partly inspired by Michael Peters's TAP::Harness::Archive. it was originally written by Lubomir Rintel (GoodData) "<lubo.rintel@gooddata.com>" and includes code from several contributors. π«Ά
the following people (in no specific order) have reported problems or contributed code to TAP::Harness::JUnit:
- David Ritter
- Jeff Lavallee
- Andreas Pohl
- Ton Voon
- Kevin Goess
- Richard Huxton
- David E. Wheeler
- Malcolm Parsons
- Finn Smith
- Toby Broyles
β¨ BUGS β¨
okay so the known issues, and we're being honest here:
- 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. π XML::Simpleis used to generate the output. this is suboptimal and involves some hacks. π- during testing the resulting files are not tested against the schema. this would be a good thing to do.
no cap on any of those. they're literally written down as bugs. π
β¨ CONTRIBUTING β¨
source code for TAP::Harness::JUnit is kept in a public Git repository. visit <https://github.com/jlavallee/tap-harness-junit>. π
bug reports and feature enhancement requests are tracked at <https://rt.cpan.org/Public/Dist/Display.html?Name=TAP-Harness-JUnit>. π
β¨ COPYRIGHT & LICENSE β¨
copyright 2008, 2009, 2010, 2011, 2012, 2013 TAP::Harness::JUnit contributors. all rights reserved. β
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
and that's the whole page bestie, mwah π β this was perl v5.42.0, dated 2015-04-13, coming at you from TAP::H...::JUnit(3pm). go forth and generate that XML π¦β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-TAP-Harness-JUnit 0.42-bp160.1.1 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms