1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
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<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
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
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.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
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
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
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'
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 \
129 .\" ========================================================================
131 .IX Title "Test::Harness 3"
132 .TH Test::Harness 3 "2009-05-05" "perl v5.8.7" "User Contributed Perl Documentation"
134 Test::Harness \- Run Perl standard test scripts with statistics
139 .IX Header "SYNOPSIS"
141 \& use Test::Harness;
145 \& runtests(@test_files);
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.
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.
160 See TAP::Parser, TAP::Harness for the main documentation for this
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.
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.
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:
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
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
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.
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:
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).
219 \&\f(CW$failed\fR should be empty if everything passed.
222 \&\f(CW&runtests\fR is exported by \f(CW\*(C`Test::Harness\*(C'\fR by default.
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
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:
257 .ie n .IP """j<n>""" 4
258 .el .IP "\f(CWj<n>\fR" 4
260 Run <n> (default 9) parallel jobs.
262 .el .IP "\f(CWf\fR" 4
264 Use forked parallelism.
268 Multiple options may be separated by colons:
271 \& HARNESS_OPTIONS=j9:f make test
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.
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.
285 .IX Header "SEE ALSO"
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
296 Andy Armstrong \f(CW\*(C`<andy@hexten.net>\*(C'\fR
298 Test::Harness 2.64 (maintained by Andy Lester and on which this
299 module is based) has this attribution:
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.
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.
312 This module is free software; you can redistribute it and/or
313 modify it under the same terms as Perl itself. See perlartistic.