| 1 | # -*- Mode: cperl; cperl-indent-level: 4 -*- | ||
| 2 | package Test::Run::Straps_GplArt; | ||
| 3 | |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Test::Run::Straps - detailed analysis of test results | ||
| 10 | |||
| 11 | =head1 WARNING | ||
| 12 | |||
| 13 | This module contains nothing but old (and possibly out of date) documentation. | ||
| 14 | All the code-wise functionality was moved to the MIT X11-licensed | ||
| 15 | L<Test::Run::Straps> and other modules. | ||
| 16 | |||
| 17 | Don't use this module, but you may wish to consult its documentation for | ||
| 18 | reference. | ||
| 19 | |||
| 20 | =head1 SYNOPSIS | ||
| 21 | |||
| 22 | use Test::Run::Straps; | ||
| 23 | |||
| 24 | my $strap = Test::Run::Straps->new; | ||
| 25 | |||
| 26 | # Various ways to interpret a test | ||
| 27 | my $results = $strap->analyze($name, \@test_output); | ||
| 28 | my $results = $strap->analyze_fh($name, $test_filehandle); | ||
| 29 | my $results = $strap->analyze_file($test_file); | ||
| 30 | |||
| 31 | # UNIMPLEMENTED | ||
| 32 | my %total = $strap->total_results; | ||
| 33 | |||
| 34 | # Altering the behavior of the strap UNIMPLEMENTED | ||
| 35 | my $verbose_output = $strap->dump_verbose(); | ||
| 36 | $strap->dump_verbose_fh($output_filehandle); | ||
| 37 | |||
| 38 | |||
| 39 | =head1 DESCRIPTION | ||
| 40 | |||
| 41 | B<THIS IS ALPHA SOFTWARE> in that the interface is subject to change | ||
| 42 | in incompatible ways. It is otherwise stable. | ||
| 43 | |||
| 44 | Test::Run is limited to printing out its results. This makes | ||
| 45 | analysis of the test results difficult for anything but a human. To | ||
| 46 | make it easier for programs to work with test results, we provide | ||
| 47 | Test::Run::Straps. Instead of printing the results, straps | ||
| 48 | provide them as raw data. You can also configure how the tests are to | ||
| 49 | be run. | ||
| 50 | |||
| 51 | The interface is currently incomplete. I<Please> contact the author | ||
| 52 | if you'd like a feature added or something change or just have | ||
| 53 | comments. | ||
| 54 | |||
| 55 | =head1 ANALYSIS | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | =head1 Parsing | ||
| 62 | |||
| 63 | Methods for identifying what sort of line you're looking at. | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | =head1 Results | ||
| 68 | |||
| 69 | The C<%results> returned from C<analyze()> contain the following | ||
| 70 | information: | ||
| 71 | |||
| 72 | passing true if the whole test is considered a pass | ||
| 73 | (or skipped), false if its a failure | ||
| 74 | |||
| 75 | exit the exit code of the test run, if from a file | ||
| 76 | wait the wait code of the test run, if from a file | ||
| 77 | |||
| 78 | max total tests which should have been run | ||
| 79 | seen total tests actually seen | ||
| 80 | skip_all if the whole test was skipped, this will | ||
| 81 | contain the reason. | ||
| 82 | |||
| 83 | ok number of tests which passed | ||
| 84 | (including todo and skips) | ||
| 85 | |||
| 86 | todo number of todo tests seen | ||
| 87 | bonus number of todo tests which | ||
| 88 | unexpectedly passed | ||
| 89 | |||
| 90 | skip number of tests skipped | ||
| 91 | |||
| 92 | So a successful test should have max == seen == ok. | ||
| 93 | |||
| 94 | |||
| 95 | There is one final item, the details. | ||
| 96 | |||
| 97 | details an array ref reporting the result of | ||
| 98 | each test looks like this: | ||
| 99 | |||
| 100 | $results{details}[$test_num - 1] = | ||
| 101 | { ok => is the test considered ok? | ||
| 102 | actual_ok => did it literally say 'ok'? | ||
| 103 | name => name of the test (if any) | ||
| 104 | diagnostics => test diagnostics (if any) | ||
| 105 | type => 'skip' or 'todo' (if any) | ||
| 106 | reason => reason for the above (if any) | ||
| 107 | }; | ||
| 108 | |||
| 109 | Element 0 of the details is test #1. I tried it with element 1 being | ||
| 110 | #1 and 0 being empty, this is less awkward. | ||
| 111 | |||
| 112 | =head1 EXAMPLES | ||
| 113 | |||
| 114 | See F<examples/mini_harness.plx> for an example of use. | ||
| 115 | |||
| 116 | =head1 AUTHOR | ||
| 117 | |||
| 118 | Michael G Schwern C<< <schwern@pobox.com> >>, later maintained by | ||
| 119 | Andy Lester C<< <andy@petdance.com> >>. | ||
| 120 | |||
| 121 | Converted to Test::Run::Straps by Shlomi Fish, L<http://www.shlomifish.org/> . | ||
| 122 | |||
| 123 | =head1 LICENSE | ||
| 124 | |||
| 125 | This file is distributed under the same terms as perl. (GPL2 or Later + | ||
| 126 | Artistic 1). | ||
| 127 | |||
| 128 | =head1 SEE ALSO | ||
| 129 | |||
| 130 | L<Test::Run> , L<Test::Run::Straps> | ||
| 131 | |||
| 132 | =cut | ||
| 133 | |||
| 134 | 1 | 1; | |