1Test2::Harness::Log::CoUvseerragCeoAngtgrriebguatteToders(Pt3e2)r:l:HDaorcnuemsesn:t:aLtoigo:n:CoverageAggregator(3)
2
3
4
6 Test2::Harness::Log::CoverageAggregator - Module for aggregating
7 coverage data from a strema of events.
8
10 This module takes a stream of events and produces aggregated coverage
11 data.
12
14 use Test2::Harness::Log::CoverageAggregator;
15
16 my $agg = Test2::Harness::Log::CoverageAggregator->new();
17
18 while (my $e = $log->next_event) {
19 $agg->process_event($e);
20 }
21
22 my $coverage = $agg->coverage;
23
24 use Test2::Harness::Util::JSON qw/encode_json/;
25 open(my $fh, '>', "coverage.json") or die "$!";
26 print $fh encode_json($coverage);
27 close($fh);
28
30 $agg->process_event($event)
31 Process the event, aggregating any coverage info it may contain.
32
33 $haashref = $agg->coverage()
34 Produce a hashref of all aggregated coverage data:
35
36 {
37 'test_file_a.t' => [
38 'lib/MyModule1.pm',
39 'lib/MyModule2.pm',
40 ...,
41 ],
42 'test_file_b.t' => [
43 'share/css/foo.css',
44 'lib/AnotherModule.pm',
45 ...
46 ],
47 ...,
48 }
49
51 The source code repository for Test2-Harness can be found at
52 http://github.com/Test-More/Test2-Harness/.
53
55 Chad Granum <exodist@cpan.org>
56
58 Chad Granum <exodist@cpan.org>
59
61 Copyright 2020 Chad Granum <exodist7@gmail.com>.
62
63 This program is free software; you can redistribute it and/or modify it
64 under the same terms as Perl itself.
65
66 See http://dev.perl.org/licenses/
67
68
69
70perl v5.32.1 202T1e-s0t32-:1:2Harness::Log::CoverageAggregator(3)