# Copyright 2005 Edmund von der Burg # Distributed under the same license as Perl itself. use strict; use warnings; use Test::More; eval { require File::Finder; 1; } || plan 'skip_all' => 'Need File::Finder'; # Check that all the modules in 'lib' have a version number. my @files = sort File::Finder->name('*.pm')->in('lib'); my @modules = map { s{ \A lib/ (.*) \.pm \z }{$1}x; s{/}{::}g; $_; } @files; # Work out how many tests will be run. plan tests => 1 + 2 * scalar @modules; # Get all the modules loaded. use_ok $_ for @modules; # Get the version from Module::API and check all the others are the # same. my $reference_version = Daemon::Pluggable->VERSION; like $reference_version, qr{ \d+ \. \d{2} }x, "got a good version number: '$reference_version'"; foreach my $module (@modules) { my $version = $module->VERSION || ''; is $version, $reference_version, "version is correct for '$module'"; }