diff options
author | Guillem Jover <guillem@debian.org> | 2017-05-18 00:12:01 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2017-05-20 05:21:33 +0200 |
commit | 983c1bc74c8e036bc5ae6d9646474d8acbc9a112 (patch) | |
tree | 72efb43d459217c8008f6d5cf622594652717140 | |
parent | c96fef71fc69b4d30ef60f7dfb5790fc1d5d31b6 (diff) | |
download | dpkg-983c1bc74c8e036bc5ae6d9646474d8acbc9a112.tar.gz |
Test::Dpkg: Add new all_perl_modules function
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | scripts/Test/Dpkg.pm | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index 9ece8fac0..5dc0bdeb9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ dpkg (1.19.0) UNRELEASED; urgency=medium - Enable perlcritic Documentation::RequirePodSections and Miscellanea::ProhibitTies. - Disable perlcritic ValuesAndExpressions::ProhibitEscapedCharacter. + - Add a new all_perl_modules function to Test::Dpkg. -- Guillem Jover <guillem@debian.org> Thu, 18 May 2017 05:27:31 +0200 diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index ba0f5394c..1b1a5d67e 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -21,6 +21,7 @@ use warnings; our $VERSION = '0.00'; our @EXPORT_OK = qw( all_perl_files + all_perl_modules test_get_perl_dirs test_get_data_path test_needs_author @@ -38,6 +39,7 @@ our %EXPORT_TAGS = ( ) ], paths => [ qw( all_perl_files + all_perl_modules test_get_perl_dirs test_get_data_path ) ], @@ -63,9 +65,10 @@ sub test_get_perl_dirs sub all_perl_files { + my $filter = shift // qr/\.(?:pl|pm|t)$/; my @files; my $scan_perl_files = sub { - push @files, $File::Find::name if m/\.(pl|pm|t)$/; + push @files, $File::Find::name if m/$filter/; }; find($scan_perl_files, test_get_perl_dirs()); @@ -73,6 +76,11 @@ sub all_perl_files return @files; } +sub all_perl_modules +{ + return all_perl_files(qr/\.pm$/); +} + sub test_needs_author { if (not $ENV{DPKG_DEVEL_MODE} and not $ENV{AUTHOR_TESTING}) { |