MyCPAN::Indexer::TestCensus - Count the Test modules used in test suites
use MyCPAN::Indexer;
This module implements the indexer_class and reporter_class components to allow backpan_indexer.pl
to count the test modules used in the indexed distributions.
It runs through the indexing and prints a report at the end of the run. You probably
Given a distribution, unpack it, look at it, and report the findings. It does everything except the looking right now, so it merely croaks. Most of this needs to move out of run and into this method.
Like setup_run_info
in MyCPAN::Indexer
, but it remembers fewer things. The test census really just cares about statements in the test files, so the details about the run aren't as interesting.
Like setup_dist_info
in MyCPAN::Indexer
, but it remembers fewer things. The test census really just cares about statements in the test files, so the details about the distribution aren't as interesting.
get_reporter
sets the reporter
key in the $Notes
hash reference. The value is a code reference that takes the information collected about a distribution and counts the modules used in the test files.
See MyCPAN::Indexer::Tutorial for details about what get_reporter
expects and should do.
foreach my $file ( glob "*.yml" ) { my $yaml = LoadFile( $file );
my $test_files = $yaml->{dist_info}{test_info}; foreach my $test_file ( @$test_files ) { my $uses = $test_file->{uses}; foreach my $used_module ( @$uses ) { $Seen{$used_module}++; } } }
This code is in Github:
git://github.com/briandfoy/mycpan-indexer.git
brian d foy, <bdfoy@cpan.org>
Copyright (c) 2008-2009, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.