Test::Harness

Test::Harness can run Perl standard test scripts with statistics.
Download

Test::Harness Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andy Armstrong
  • Publisher web site:
  • http://search.cpan.org/~andya/

Test::Harness Tags


Test::Harness Description

Test::Harness can run Perl standard test scripts with statistics. Test::Harness can run Perl standard test scripts with statistics.SYNOPSIS use Test::Harness; runtests(@test_files);Although, for historical reasons, the Test::Harness distribution takes its name from this module it now exists only to provide TAP::Harness with an interface that is somewhat backwards compatible with Test::Harness 2.xx. If you're writing new code consider using TAP::Harness directly instead.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.FUNCTIONSThe following functions are available.runtests( @test_files )This runs all the given @test_files and divines whether they passed or failed based on their output to STDOUT (details above). It prints out each individual test which failed along with a summary report and a how long it all took.It returns true if everything was ok. Otherwise it will die() with one of the messages in the DIAGNOSTICS section.execute_tests( tests => @test_files, out => *FH )Runs all the given @test_files (just like runtests()) but doesn't generate the final report. During testing, progress information will be written to the currently selected output filehandle (usually STDOUT), or to the filehandle given by the out parameter. The out is optional.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 skippedIf $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. Requirements: · Perl


Test::Harness Related Software