1TAP::Formatter::JUnit(3U)ser Contributed Perl DocumentatiToAnP::Formatter::JUnit(3)
2
3
4
6 TAP::Formatter::JUnit - Harness output delegate for JUnit output
7
9 On the command line, with prove:
10
11 $ prove --formatter TAP::Formatter::JUnit ...
12
13 Or, in your own scripts:
14
15 use TAP::Harness;
16
17 # What TAP output did we save from a previous run, with
18 # PERL_TEST_HARNESS_DUMP_TAP=tap/
19 my @tests = glob("tap/*.t");
20
21 # Convert the TAP to JUnit
22 my $harness = TAP::Harness->new( {
23 formatter_class => 'TAP::Formatter::JUnit',
24 merge => 1,
25 } );
26 $harness->runtests(@tests);
27
29 This code is currently in alpha state and is subject to change.
30
31 "TAP::Formatter::JUnit" provides JUnit output formatting for
32 "TAP::Harness".
33
34 By default (e.g. when run with prove), the entire test suite is
35 gathered together into a single JUnit XML document, which is then
36 displayed on "STDOUT". You can, however, have individual JUnit XML
37 files dumped for each individual test, by setting
38 "PERL_TEST_HARNESS_DUMP_TAP" to a directory that you would like the
39 JUnit XML dumped to. Note, that this will also cause "TAP::Harness" to
40 dump the original TAP output into that directory as well (but IMHO
41 that's ok as you've now got the data in two parseable formats).
42
43 Timing information is included in the JUnit XML, if you specified
44 "--timer" when you ran prove.
45
46 In standard use, a "passing TODO" is treated as failure conditions (and
47 is reported as such in the generated JUnit). If you wish to treat
48 these as a "pass" and not a "fail" condition, setting
49 "ALLOW_PASSING_TODOS" in your environment will turn these into pass
50 conditions.
51
52 The JUnit output generated is partial to being grokked by Hudson
53 (<http://hudson.dev.java.net/>). That's the build tool I'm using at
54 the moment and needed to be able to generate JUnit output for.
55
57 testsuites
58 List-ref of test suites that have been executed.
59
60 xml An "XML::Generator" instance, to be used to generate XML output.
61
63 open_test($test, $parser)
64 Over-ridden open_test() method.
65
66 Creates a "TAP::Formatter::JUnit::Session" session, instead of a
67 console formatter session.
68
69 summary()
70 Prints the summary report (in JUnit) after all tests are run.
71
72 add_testsuite($suite)
73 Adds the given XML test $suite to the list of test suites that
74 we've executed and need to summarize.
75
77 Graham TerMarsch <cpan@howlingfrog.com>
78
79 Many thanks to Andy Armstrong and all those involved for the fabulous
80 set of tests in "Test::Harness"; they became the basis for the unit
81 tests here.
82
83 Other thanks go out to those that have provided feedback, comments, or
84 patches:
85
86 Mark Aufflick
87 Joe McMahon
88 Michael Nachbaur
89 Marc Abramowitz
90 Colin Robertson
91 Phillip Kimmey
92 Dave Lambley
93
95 Copyright 2008-2010, Graham TerMarsch. All Rights Reserved.
96
97 This is free software; you can redistribute it and/or modify it under
98 the same terms as Perl itself.
99
101 TAP::Formatter::Console
102 TAP::Formatter::JUnit::Session
103 Hudson home page <http://hudson.dev.java.net/>
104 JUnitXSchema.xsd <http://jra1mw.cvs.cern.ch:8180/cgi-
105 bin/jra1mw.cgi/org.glite.testing.unit/config/JUnitXSchema.xsd?view=markup&content-
106 type=text%2Fvnd.viewcvs-markup&revision=HEAD>
107 JUnit parsing in Bamboo
108 <http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo>.
109
110
111
112perl v5.38.0 2023-07-21 TAP::Formatter::JUnit(3)