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