File: release-perlcritic.t

package info (click to toggle)
libpostscript-file-perl 2.20%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 808 kB
  • ctags: 274
  • sloc: perl: 7,065; sh: 48; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/perl

BEGIN {
  unless ($ENV{RELEASE_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for release candidate testing');
  }
}

#---------------------------------------------------------------------
# $Id: perlcritic.t 2035 2008-06-25 23:41:21Z cjm $
#---------------------------------------------------------------------

use Test::More;

plan skip_all => "Don't want automated Perl::Critic reports"
    if $ENV{AUTOMATED_TESTING};

# ProhibitAccessOfPrivateData is a badly implemented policy that bans
# all use of hashrefs
eval <<'';
use Test::Perl::Critic (qw(-verbose 10
                           -exclude) => ['ProhibitAccessOfPrivateData']);
use Perl::Critic::Utils 'all_perl_files';
use File::Spec ();

plan skip_all => "Test::Perl::Critic required for testing PBP compliance" if $@;

# I don't want to check the Metrics data files:

my $skipRE = File::Spec->catfile(qw(lib PostScript File Metrics x));
chop $skipRE;                   # Remove the x
$skipRE = qr/\Q$skipRE\E(?!Loader)/;

my @files = grep { not $_ =~ $skipRE } all_perl_files('lib');

plan tests => scalar @files;

critic_ok($_) for @files;