NAME
MyCPAN::Indexer::TestCensus - Count the Test modules used in test suites
SYNOPSIS
use MyCPAN::Indexer;
DESCRIPTION
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
Indexer class
- examine_dist
-
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.
- setup_run_info
-
Like
setup_run_info
inMyCPAN::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. - setup_dist_info
-
Like
setup_dist_info
inMyCPAN::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.
Reporter class
- get_reporter( $Notes )
-
get_reporter
sets thereporter
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}++; } } }
TO DO
SOURCE AVAILABILITY
This code is in Github:
git://github.com/briandfoy/mycpan-indexer.git
AUTHOR
brian d foy, <bdfoy@cpan.org>
COPYRIGHT AND LICENSE
Copyright © 2008-2018, brian d foy <bdfoy@cpan.org>. All rights reserved.
You may redistribute this under the terms of the Artistic License 2.0.