1
0

critic.t 903 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!perl -T
  2. # vi: set tabstop=4 expandtab shiftwidth=4:
  3. use strict;
  4. use warnings;
  5. use Test::More;
  6. use ExtUtils::Manifest qw/maniread/;
  7. delete $ENV{PATH};
  8. my @perl_files;
  9. BEGIN {
  10. my $manifest = maniread();
  11. die 'Unable to read MANIFEST' unless $manifest;
  12. foreach my $file (keys %$manifest) {
  13. if ($file =~ m/.*\.p[ml]$/x) {
  14. push @perl_files, ($file);
  15. }
  16. }
  17. }
  18. unless ($ENV{RELEASE_TESTING}) {
  19. plan(skip_all => 'Author tests not required for installation');
  20. }
  21. else {
  22. eval { require Test::Perl::Critic; };
  23. if ($@) {
  24. plan(skip_all => 'Test::Perl::Critic required');
  25. }
  26. else {
  27. Test::Perl::Critic->import(
  28. -severity => 4,
  29. -exclude => 'Variables::RequireLocalizedPunctuationVars'
  30. );
  31. plan(tests => scalar @perl_files);
  32. }
  33. }
  34. foreach my $file (sort @perl_files) {
  35. critic_ok($file);
  36. }