1TAP::Harness::Archive::UMsuelrtiCpolnetHrairbnuetTseAsdPe:sP:(eH3ra)lrnDeoscsu:m:eAnrtcahtiivoen::MultipleHarnesses(3)
2
3
4
6 TAP::Harness::Archive::MultipleHarnesses - Create an archive of
7 multiple harnesses of TAP test results
8
10 use TAP::Harness::Archive::MultipleHarnesses;
11 my $archive = TAP::Harness::Archive::MultipleHarnesses->new(\%args);
12 $archive->runtests(\@targets);
13
15 This package subclasses Michael Peters' TAP::Harness::Archive package
16 from CPAN. It provides its own "runtests()" method for the case where
17 you need to create an archive of test results generated by running
18 multiple harnesses sequentially.
19
20 For a discussion of use cases for this functionality, see the
21 documentation for TAP::Harness::ReportByDescription.
22
23 perldoc TAP::Harness::ReportByDescription
24
26 "new()"
27 Inherited from Test::Harness::Archive.
28
29 "runtests()"
30 Replaces "Test::Harness::Archive::runtests()". Note that its interface
31 is different from other packages' "runtests()" interface: It takes a
32 reference to an array of hash references rather than a simple array.
33
34 Each hash reference holds information on how a particular set of tests
35 is to be run. The various sets are run and placed into the archive in
36 the order in which they appear in the array.
37
38 Each hash reference needs three elements:
39
40 • "tests"
41
42 A list of tests to be run (typically expressed as a list of file
43 glob patterns).
44
45 • "rule"
46
47 A reference to a subroutine which will be run before a given set of
48 tests is executed. The purpose of this subroutine is to set up
49 the environmental variables as needed for a particular subharness.
50
51 • "label"
52
53 A string describing a particular subharness which will be combined
54 with a particular test file's name to form the description of the
55 test both in STDOUT and in the test archive.
56
57 "summary()"
58 Inherited from Test::Harness::Archive.
59
61 Adapted (simplified) from Parrot's "t/fullharness".
62
63 use Parrot::Harness::Smoke qw( collect_test_environment_data );
64 use TAP::Harness::Archive::MultipleHarnesses;
65
66 sub set_runcore_target {
67 my ($target) = @_;
68 return {
69 label => "test$target",
70 rule => sub { set_runcore_environmental_args($target) },
71 tests => [
72 map { [ $_, "test${alt}__$_", ] }
73 @Parrot::Harness::TestSets::runcore_test_files
74 ],
75 };
76 }
77 my @targets = map { set_runcore_target($_) } ( qw| b f r | );
78 my %env_data = collect_test_environment_data();
79
80 my $archive = TAP::Harness::Archive::MultipleHarnesses->new( {
81 verbosity => $ENV{HARNESS_VERBOSE},
82 archive => 'parrot_test_run.tar.gz',
83 merge => 1,
84 jobs => $ENV{TEST_JOBS} || 1,
85 extra_properties => \%env_data,
86 extra_files => [ 'myconfig', 'config_lib.pir' ],
87 } );
88 my $overall_aggregator = $archive->runtests(\@targets);
89 $archive->summary($overall_aggregator);
90
92 This code was derived from Michael Peters' Test::Harness::Archive
93 distribution on CPAN, as well as examples in the documentation for
94 TAP::Harness, TAP::Parser, TAP::Parser::Aggregator and other CPAN
95 modules. Documentation and code assemblage by James E Keenan.
96
98 This is free software and is released under the same terms as Perl
99 itself.
100
101
102
103perl v5.36.0 20T2A2P-:0:7H-a2r2ness::Archive::MultipleHarnesses(3)