1TAP::Harness::Archive(3U)ser Contributed Perl DocumentatiToAnP::Harness::Archive(3)
2
3
4
6 TAP::Harness::Archive - Create an archive of TAP test results
7
9 use TAP::Harness::Archive;
10 my $harness = TAP::Harness::Archive->new(\%args);
11 $harness->runtests(@tests);
12
14 This module is a direct subclass of TAP::Harness and behaves in exactly
15 the same way except for one detail. In addition to outputting a running
16 progress of the tests and an ending summary it can also capture all of
17 the raw TAP from the individual test files or streams into an archive
18 file (".tar" or ".tar.gz").
19
21 All methods are exactly the same as our base TAP::Harness except for
22 the following.
23
24 new
25 In addition to the options that TAP::Harness allow to this method, we
26 also allow the following:
27
28 archive
29 This is the name of the archive file to generate. We use
30 Archive::Tar in the background so we only support ".tar" and
31 ".tar.gz" archive file formats. This can optionally be an existing
32 directory that will have the TAP archive's contents deposited
33 therein without any file archiving (no Archive::Tar involved).
34
35 extra_files
36 This is an array reference to extra files that you want to include
37 in the TAP archive but which are not TAP files themselves. This is
38 useful if you want to include some log files that contain useful
39 information about the test run.
40
41 extra_properties
42 This is a hash reference of extra properties that you've collected
43 during your test run. Some things you might want to include are the
44 Perl version, the system's architecture, the operating system, etc.
45
46 runtests
47 Takes the same arguments as TAP::Harness's version and returns the same
48 thing (a TAP::Parser::Aggregator object). The only difference is that
49 in addition to the normal test running and progress output we also
50 create the TAP Archive when it's all done.
51
52 aggregator_from_archive
53 This class method will return a TAP::Parser::Aggregator object when
54 given a TAP Archive to open and parse. It's pretty much the reverse of
55 creating a TAP Archive from using "new" and "runtests".
56
57 It takes a hash of arguments which are as follows:
58
59 archive
60 The path to the archive file. This can also be a directory if you
61 created the archive as a directory. This is required.
62
63 parser_callbacks
64 This is a hash ref containing callbacks for the TAP::Parser objects
65 that are created while parsing the TAP files. See the TAP::Parser
66 documentation for details about these callbacks.
67
68 made_parser_callback
69 This callback is executed every time a new TAP::Parser object is
70 created. It will be passed the new parser object, the name of the
71 file to be parsed, and also the full (temporary) path of that file.
72
73 meta_yaml_callback
74 This is a subroutine that will be called if we find and parse a
75 YAML file containing meta information about the test run in the
76 archive. The structure of the YAML file will be passed in as an
77 argument.
78
79 my $aggregator = TAP::Harness::Archive->aggregator_from_archive(
80 {
81 archive => 'my_tests.tar.gz',
82 parser_callbacks => {
83 plan => sub { warn "Nice to see you plan ahead..." },
84 unknown => sub { warn "Your TAP is bad!" },
85 },
86 made_parser_callback => sub {
87 my ($parser, $file, $full_path) = @_;
88 warn "$file is temporarily located at $full_path\n";
89 }
90
91 }
92 );
93
95 Michael Peters, "<mpeters at plusthree.com>"
96
98 Please report any bugs or feature requests to "bug-tap-harness-archive
99 at rt.cpan.org", or through the web interface at
100 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=TAP-Harness-Archive>.
101 I will be notified, and then you'll automatically be notified of
102 progress on your bug as I make changes.
103
105 You can find documentation for this module with the perldoc command.
106
107 perldoc TAP::Harness::Archive
108
109 You can also look for information at:
110
111 • AnnoCPAN: Annotated CPAN documentation
112
113 <http://annocpan.org/dist/TAP-Harness-Archive>
114
115 • CPAN Ratings
116
117 <http://cpanratings.perl.org/d/TAP-Harness-Archive>
118
119 • RT: CPAN's request tracker
120
121 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=TAP-Harness-Archive>
122
123 • Search CPAN
124
125 <http://search.cpan.org/dist/TAP-Harness-Archive>
126
128 • A big thanks to Plus Three, LP (<http://www.plusthree.com>) for
129 sponsoring my work on this module and other open source pursuits.
130
131 • Andy Armstrong
132
134 Copyright 2007 Michael Peters, all rights reserved.
135
136 This program is free software; you can redistribute it and/or modify it
137 under the same terms as Perl itself.
138
139
140
141perl v5.34.0 2022-01-21 TAP::Harness::Archive(3)