Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / Test::Harness.3pm
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "Test::Harness 3"
132 .TH Test::Harness 3 "2009-05-05" "perl v5.8.7" "User Contributed Perl Documentation"
133 .SH "NAME"
134 Test::Harness \- Run Perl standard test scripts with statistics
135 .SH "VERSION"
136 .IX Header "VERSION"
137 Version 3.17
138 .SH "SYNOPSIS"
139 .IX Header "SYNOPSIS"
140 .Vb 1
141 \&  use Test::Harness;
142 .Ve
143 .PP
144 .Vb 1
145 \&  runtests(@test_files);
146 .Ve
147 .SH "DESCRIPTION"
148 .IX Header "DESCRIPTION"
149 Although, for historical reasons, the Test::Harness distribution
150 takes its name from this module it now exists only to provide
151 TAP::Harness with an interface that is somewhat backwards compatible
152 with Test::Harness 2.xx. If you're writing new code consider using
153 TAP::Harness directly instead.
154 .PP
155 Emulation is provided for \f(CW\*(C`runtests\*(C'\fR and \f(CW\*(C`execute_tests\*(C'\fR but the
156 pluggable 'Straps' interface that previous versions of Test::Harness
157 supported is not reproduced here. Straps is now available as a stand
158 alone module: Test::Harness::Straps.
159 .PP
160 See TAP::Parser, TAP::Harness for the main documentation for this
161 distribution.
162 .SH "FUNCTIONS"
163 .IX Header "FUNCTIONS"
164 The following functions are available.
165 .ie n .Sh "runtests( @test_files )"
166 .el .Sh "runtests( \f(CW@test_files\fP )"
167 .IX Subsection "runtests( @test_files )"
168 This runs all the given \fI@test_files\fR and divines whether they passed
169 or failed based on their output to \s-1STDOUT\s0 (details above).  It prints
170 out each individual test which failed along with a summary report and
171 a how long it all took.
172 .PP
173 It returns true if everything was ok.  Otherwise it will \f(CW\*(C`die()\*(C'\fR with
174 one of the messages in the \s-1DIAGNOSTICS\s0 section.
175 .Sh "execute_tests( tests => \e@test_files, out => \e*FH )"
176 .IX Subsection "execute_tests( tests => @test_files, out => *FH )"
177 Runs all the given \f(CW@test_files\fR (just like \f(CW\*(C`runtests()\*(C'\fR) but
178 doesn't generate the final report.  During testing, progress
179 information will be written to the currently selected output
180 filehandle (usually \f(CW\*(C`STDOUT\*(C'\fR), or to the filehandle given by the
181 \&\f(CW\*(C`out\*(C'\fR parameter.  The \fIout\fR is optional.
182 .PP
183 Returns a list of two values, \f(CW$total\fR and \f(CW$failed\fR, describing the
184 results.  \f(CW$total\fR is a hash ref summary of all the tests run.  Its
185 keys and values are this:
186 .PP
187 .Vb 5
188 \&    bonus           Number of individual todo tests unexpectedly passed
189 \&    max             Number of individual tests ran
190 \&    ok              Number of individual tests passed
191 \&    sub_skipped     Number of individual tests skipped
192 \&    todo            Number of individual todo tests
193 .Ve
194 .PP
195 .Vb 5
196 \&    files           Number of test files ran
197 \&    good            Number of test files passed
198 \&    bad             Number of test files failed
199 \&    tests           Number of test files originally given
200 \&    skipped         Number of test files skipped
201 .Ve
202 .PP
203 If \f(CW\*(C`$total\->{bad} == 0\*(C'\fR and \f(CW\*(C`$total\->{max} > 0\*(C'\fR, you've
204 got a successful test.
205 .PP
206 \&\f(CW$failed\fR is a hash ref of all the test scripts that failed.  Each key
207 is the name of a test script, each value is another hash representing
208 how that script failed.  Its keys are these:
209 .PP
210 .Vb 6
211 \&    name        Name of the test which failed
212 \&    estat       Script's exit value
213 \&    wstat       Script's wait status
214 \&    max         Number of individual tests
215 \&    failed      Number which failed
216 \&    canon       List of tests which failed (as string).
217 .Ve
218 .PP
219 \&\f(CW$failed\fR should be empty if everything passed.
220 .SH "EXPORT"
221 .IX Header "EXPORT"
222 \&\f(CW&runtests\fR is exported by \f(CW\*(C`Test::Harness\*(C'\fR by default.
223 .PP
224 \&\f(CW&execute_tests\fR, \f(CW$verbose\fR, \f(CW$switches\fR and \f(CW$debug\fR are
225 exported upon request.
226 .SH "ENVIRONMENT VARIABLES THAT TAP::HARNESS::COMPATIBLE SETS"
227 .IX Header "ENVIRONMENT VARIABLES THAT TAP::HARNESS::COMPATIBLE SETS"
228 \&\f(CW\*(C`Test::Harness\*(C'\fR sets these before executing the individual tests.
229 .ie n .IP """HARNESS_ACTIVE""" 4
230 .el .IP "\f(CWHARNESS_ACTIVE\fR" 4
231 .IX Item "HARNESS_ACTIVE"
232 This is set to a true value.  It allows the tests to determine if they
233 are being executed through the harness or by any other means.
234 .ie n .IP """HARNESS_VERSION""" 4
235 .el .IP "\f(CWHARNESS_VERSION\fR" 4
236 .IX Item "HARNESS_VERSION"
237 This is the version of \f(CW\*(C`Test::Harness\*(C'\fR.
238 .SH "ENVIRONMENT VARIABLES THAT AFFECT TEST::HARNESS"
239 .IX Header "ENVIRONMENT VARIABLES THAT AFFECT TEST::HARNESS"
240 .ie n .IP """HARNESS_TIMER""" 4
241 .el .IP "\f(CWHARNESS_TIMER\fR" 4
242 .IX Item "HARNESS_TIMER"
243 Setting this to true will make the harness display the number of
244 milliseconds each test took.  You can also use \fIprove\fR's \f(CW\*(C`\-\-timer\*(C'\fR
245 switch.
246 .ie n .IP """HARNESS_VERBOSE""" 4
247 .el .IP "\f(CWHARNESS_VERBOSE\fR" 4
248 .IX Item "HARNESS_VERBOSE"
249 If true, \f(CW\*(C`Test::Harness\*(C'\fR will output the verbose results of running
250 its tests.  Setting \f(CW$Test::Harness::verbose\fR will override this,
251 or you can use the \f(CW\*(C`\-v\*(C'\fR switch in the \fIprove\fR utility.
252 .ie n .IP """HARNESS_OPTIONS""" 4
253 .el .IP "\f(CWHARNESS_OPTIONS\fR" 4
254 .IX Item "HARNESS_OPTIONS"
255 Provide additional options to the harness. Currently supported options are:
256 .RS 4
257 .ie n .IP """j<n>""" 4
258 .el .IP "\f(CWj<n>\fR" 4
259 .IX Item "j<n>"
260 Run <n> (default 9) parallel jobs.
261 .ie n .IP """f""" 4
262 .el .IP "\f(CWf\fR" 4
263 .IX Item "f"
264 Use forked parallelism.
265 .RE
266 .RS 4
267 .Sp
268 Multiple options may be separated by colons:
269 .Sp
270 .Vb 1
271 \&    HARNESS_OPTIONS=j9:f make test
272 .Ve
273 .RE
274 .SH "Taint Mode"
275 .IX Header "Taint Mode"
276 Normally when a Perl program is run in taint mode the contents of the
277 \&\f(CW\*(C`PERL5LIB\*(C'\fR environment variable do not appear in \f(CW@INC\fR.
278 .PP
279 Because \f(CW\*(C`PERL5LIB\*(C'\fR is often used during testing to add build
280 directories to \f(CW@INC\fR \f(CW\*(C`Test::Harness\*(C'\fR (actually
281 TAP::Parser::Source::Perl) passes the names of any directories found
282 in \f(CW\*(C`PERL5LIB\*(C'\fR as \-I switches. The net effect of this is that
283 \&\f(CW\*(C`PERL5LIB\*(C'\fR is honoured even in taint mode.
284 .SH "SEE ALSO"
285 .IX Header "SEE ALSO"
286 TAP::Harness
287 .SH "BUGS"
288 .IX Header "BUGS"
289 Please report any bugs or feature requests to
290 \&\f(CW\*(C`bug\-test\-harness at rt.cpan.org\*(C'\fR, or through the web interface at
291 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test\-Harness>.  I will be 
292 notified, and then you'll automatically be notified of progress on your bug 
293 as I make changes.
294 .SH "AUTHORS"
295 .IX Header "AUTHORS"
296 Andy Armstrong  \f(CW\*(C`<andy@hexten.net>\*(C'\fR
297 .PP
298 Test::Harness 2.64 (maintained by Andy Lester and on which this
299 module is based) has this attribution:
300 .PP
301 .Vb 5
302 \&    Either Tim Bunce or Andreas Koenig, we don't know. What we know for
303 \&    sure is, that it was inspired by Larry Wall's F<TEST> script that came
304 \&    with perl distributions for ages. Numerous anonymous contributors
305 \&    exist.  Andreas Koenig held the torch for many years, and then
306 \&    Michael G Schwern.
307 .Ve
308 .SH "LICENCE AND COPYRIGHT"
309 .IX Header "LICENCE AND COPYRIGHT"
310 Copyright (c) 2007\-2008, Andy Armstrong \f(CW\*(C`<andy@hexten.net>\*(C'\fR. All rights reserved.
311 .PP
312 This module is free software; you can redistribute it and/or
313 modify it under the same terms as Perl itself. See perlartistic.