use Test::Harness; runtests(@test_files);
Emulation is provided for "runtests" and "execute_tests" but the pluggable 'Straps' interface that previous versions of Test::Harness supported is not reproduced here. Straps is now available as a stand alone module: Test::Harness::Straps.
See TAP::Parser, TAP::Harness for the main documentation for this distribution.
It returns true if everything was ok. Otherwise it will "die()" with one of the messages in the DIAGNOSTICS section.
Returns a list of two values, $total and $failed, describing the results. $total is a hash ref summary of all the tests run. Its keys and values are this:
bonus Number of individual todo tests unexpectedly passed
max Number of individual tests ran
ok Number of individual tests passed
sub_skipped Number of individual tests skipped
todo Number of individual todo tests
files Number of test files ran
good Number of test files passed
bad Number of test files failed
tests Number of test files originally given
skipped Number of test files skipped
If "$total->{bad} == 0" and "$total->{max} > 0", you've got a successful test.
$failed is a hash ref of all the test scripts that failed. Each key is the name of a test script, each value is another hash representing how that script failed. Its keys are these:
name Name of the test which failed
estat Script's exit value
wstat Script's wait status
max Number of individual tests
failed Number which failed
canon List of tests which failed (as string).
$failed should be empty if everything passed.
&execute_tests, $verbose, $switches and $debug are exported upon request.
Multiple options may be separated by colons:
HARNESS_OPTIONS=j9:f make test
Because "PERL5LIB" is often used during testing to add build directories to @INC "Test::Harness" (actually TAP::Parser::Source::Perl) passes the names of any directories found in "PERL5LIB" as -I switches. The net effect of this is that "PERL5LIB" is honoured even in taint mode.
Test::Harness 2.64 (maintained by Andy Lester and on which this module is based) has this attribution:
Either Tim Bunce or Andreas Koenig, we don't know. What we know for
sure is, that it was inspired by Larry Wall's F<TEST> script that came
with perl distributions for ages. Numerous anonymous contributors
exist. Andreas Koenig held the torch for many years, and then
Michael G Schwern.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.