Test::Harness::Results

Perl 5 version 10.0 documentation

Test::Harness::Results

NAME

Test::Harness::Results - object for tracking results from a single test file

SYNOPSIS

One Test::Harness::Results object represents the results from one test file getting analyzed.

CONSTRUCTION

new()

  1. my $results = new Test::Harness::Results;

Create a test point object. Typically, however, you'll not create one yourself, but access a Results object returned to you by Test::Harness::Results.

ACCESSORS

The following data points are defined:

  1. passing true if the whole test is considered a pass
  2. (or skipped), false if its a failure
  3. exit the exit code of the test run, if from a file
  4. wait the wait code of the test run, if from a file
  5. max total tests which should have been run
  6. seen total tests actually seen
  7. skip_all if the whole test was skipped, this will
  8. contain the reason.
  9. ok number of tests which passed
  10. (including todo and skips)
  11. todo number of todo tests seen
  12. bonus number of todo tests which
  13. unexpectedly passed
  14. skip number of tests skipped

So a successful test should have max == seen == ok.

There is one final item, the details.

  1. details an array ref reporting the result of
  2. each test looks like this:
  3. $results{details}[$test_num - 1] =
  4. { ok => is the test considered ok?
  5. actual_ok => did it literally say 'ok'?
  6. name => name of the test (if any)
  7. diagnostics => test diagnostics (if any)
  8. type => 'skip' or 'todo' (if any)
  9. reason => reason for the above (if any)
  10. };

Element 0 of the details is test #1. I tried it with element 1 being #1 and 0 being empty, this is less awkward.

Each of the following fields has a getter and setter method.

  • wait
  • exit
 

Recently read

Tools