"ok N"for each single test, where
Nis an increasing sequence of integers. The first line output by a standard test script is
Mbeing the number of tests that should be run within the test script. Test::Harness::runtests(@tests) runs all the testscripts named as arguments and checks standard output for the expected
After all tests have been performed,
runtests() prints some
performance statistics that are computed by the Benchmark module.
/^(not\s+)?ok/are interpreted as feedback for
runtests().All other lines are discarded.
It is tolerated if the test numbers after
ok are omitted. In this case Test::Harness maintains temporarily its own
counter until the script supplies test numbers again. So the following test
print <<END; 1..6 not ok ok not ok ok ok END
FAILED tests 1, 3, 6 Failed 3/6 tests, 50.00% okay
The global variable $Test::Harness::verbose is exportable and can be used
runtests() display the standard output of the script
without altering the behavior otherwise.
The global variable $Test::Harness::switches is exportable and can be used
to set perl command line options used for running the test
script(s). The default value is
&runtestsis exported by Test::Harness per default.
$? >> 8and
$?are printed in a message similar to the above.
#!) line may not be portable because $^X is not consistent for shebang scripts across platforms. This is no problem when Test::Harness is run with an absolute path to the perl binary or when $^X can be found in the path.