| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "TAP::Formatter::Base 3perl" |
| 58 |
.TH TAP::Formatter::Base 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
TAP::Formatter::Base \- Base class for harness output delegates |
| 65 |
.SH VERSION |
| 66 |
.IX Header "VERSION" |
| 67 |
Version 3.48 |
| 68 |
.SH DESCRIPTION |
| 69 |
.IX Header "DESCRIPTION" |
| 70 |
This provides console orientated output formatting for TAP::Harness. |
| 71 |
.SH SYNOPSIS |
| 72 |
.IX Header "SYNOPSIS" |
| 73 |
.Vb 2 |
| 74 |
\& use TAP::Formatter::Console; |
| 75 |
\& my $harness = TAP::Formatter::Console\->new( \e%args ); |
| 76 |
.Ve |
| 77 |
.SH METHODS |
| 78 |
.IX Header "METHODS" |
| 79 |
.SS "Class Methods" |
| 80 |
.IX Subsection "Class Methods" |
| 81 |
\fR\f(CI\*(C`new\*(C'\fR\fI\fR |
| 82 |
.IX Subsection "new" |
| 83 |
.PP |
| 84 |
.Vb 4 |
| 85 |
\& my %args = ( |
| 86 |
\& verbose => 1, |
| 87 |
\& ) |
| 88 |
\& my $harness = TAP::Formatter::Console\->new( \e%args ); |
| 89 |
.Ve |
| 90 |
.PP |
| 91 |
The constructor returns a new \f(CW\*(C`TAP::Formatter::Console\*(C'\fR object. If |
| 92 |
a TAP::Harness is created with no \f(CW\*(C`formatter\*(C'\fR a |
| 93 |
\&\f(CW\*(C`TAP::Formatter::Console\*(C'\fR is automatically created. If any of the |
| 94 |
following options were given to TAP::Harness\->new they well be passed to |
| 95 |
this constructor which accepts an optional hashref whose allowed keys are: |
| 96 |
.IP \(bu 4 |
| 97 |
\&\f(CW\*(C`verbosity\*(C'\fR |
| 98 |
.Sp |
| 99 |
Set the verbosity level. |
| 100 |
.IP \(bu 4 |
| 101 |
\&\f(CW\*(C`verbose\*(C'\fR |
| 102 |
.Sp |
| 103 |
Printing individual test results to STDOUT. |
| 104 |
.IP \(bu 4 |
| 105 |
\&\f(CW\*(C`timer\*(C'\fR |
| 106 |
.Sp |
| 107 |
Append run time for each test to output. Uses Time::HiRes if available. |
| 108 |
.IP \(bu 4 |
| 109 |
\&\f(CW\*(C`failures\*(C'\fR |
| 110 |
.Sp |
| 111 |
Show test failures (this is a no-op if \f(CW\*(C`verbose\*(C'\fR is selected). |
| 112 |
.IP \(bu 4 |
| 113 |
\&\f(CW\*(C`comments\*(C'\fR |
| 114 |
.Sp |
| 115 |
Show test comments (this is a no-op if \f(CW\*(C`verbose\*(C'\fR is selected). |
| 116 |
.IP \(bu 4 |
| 117 |
\&\f(CW\*(C`quiet\*(C'\fR |
| 118 |
.Sp |
| 119 |
Suppressing some test output (mostly failures while tests are running). |
| 120 |
.IP \(bu 4 |
| 121 |
\&\f(CW\*(C`really_quiet\*(C'\fR |
| 122 |
.Sp |
| 123 |
Suppressing everything but the tests summary. |
| 124 |
.IP \(bu 4 |
| 125 |
\&\f(CW\*(C`silent\*(C'\fR |
| 126 |
.Sp |
| 127 |
Suppressing all output. |
| 128 |
.IP \(bu 4 |
| 129 |
\&\f(CW\*(C`errors\*(C'\fR |
| 130 |
.Sp |
| 131 |
If parse errors are found in the TAP output, a note of this will be made |
| 132 |
in the summary report. To see all of the parse errors, set this argument to |
| 133 |
true: |
| 134 |
.Sp |
| 135 |
.Vb 1 |
| 136 |
\& errors => 1 |
| 137 |
.Ve |
| 138 |
.IP \(bu 4 |
| 139 |
\&\f(CW\*(C`directives\*(C'\fR |
| 140 |
.Sp |
| 141 |
If set to a true value, only test results with directives will be displayed. |
| 142 |
This overrides other settings such as \f(CW\*(C`verbose\*(C'\fR, \f(CW\*(C`failures\*(C'\fR, or \f(CW\*(C`comments\*(C'\fR. |
| 143 |
.IP \(bu 4 |
| 144 |
\&\f(CW\*(C`stdout\*(C'\fR |
| 145 |
.Sp |
| 146 |
A filehandle for catching standard output. |
| 147 |
.IP \(bu 4 |
| 148 |
\&\f(CW\*(C`color\*(C'\fR |
| 149 |
.Sp |
| 150 |
If defined specifies whether color output is desired. If \f(CW\*(C`color\*(C'\fR is not |
| 151 |
defined it will default to color output if color support is available on |
| 152 |
the current platform and output is not being redirected. |
| 153 |
.IP \(bu 4 |
| 154 |
\&\f(CW\*(C`jobs\*(C'\fR |
| 155 |
.Sp |
| 156 |
The number of concurrent jobs this formatter will handle. |
| 157 |
.IP \(bu 4 |
| 158 |
\&\f(CW\*(C`show_count\*(C'\fR |
| 159 |
.Sp |
| 160 |
Boolean value. If false, disables the \f(CW\*(C`X/Y\*(C'\fR test count which shows up while |
| 161 |
tests are running. |
| 162 |
.PP |
| 163 |
Any keys for which the value is \f(CW\*(C`undef\*(C'\fR will be ignored. |
| 164 |
.PP |
| 165 |
\fR\f(CI\*(C`prepare\*(C'\fR\fI\fR |
| 166 |
.IX Subsection "prepare" |
| 167 |
.PP |
| 168 |
Called by Test::Harness before any test output is generated. |
| 169 |
.PP |
| 170 |
This is an advisory and may not be called in the case where tests are |
| 171 |
being supplied to Test::Harness by an iterator. |
| 172 |
.PP |
| 173 |
\fR\f(CI\*(C`open_test\*(C'\fR\fI\fR |
| 174 |
.IX Subsection "open_test" |
| 175 |
.PP |
| 176 |
Called to create a new test session. A test session looks like this: |
| 177 |
.PP |
| 178 |
.Vb 6 |
| 179 |
\& my $session = $formatter\->open_test( $test, $parser ); |
| 180 |
\& while ( defined( my $result = $parser\->next ) ) { |
| 181 |
\& $session\->result($result); |
| 182 |
\& exit 1 if $result\->is_bailout; |
| 183 |
\& } |
| 184 |
\& $session\->close_test; |
| 185 |
.Ve |
| 186 |
.PP |
| 187 |
\fR\f(CI\*(C`summary\*(C'\fR\fI\fR |
| 188 |
.IX Subsection "summary" |
| 189 |
.PP |
| 190 |
.Vb 1 |
| 191 |
\& $harness\->summary( $aggregate ); |
| 192 |
.Ve |
| 193 |
.PP |
| 194 |
\&\f(CW\*(C`summary\*(C'\fR prints the summary report after all tests are run. The first |
| 195 |
argument is an aggregate to summarise. An optional second argument may |
| 196 |
be set to a true value to indicate that the summary is being output as a |
| 197 |
result of an interrupted test run. |