3 ##############################################################################
4 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/xt/author/41_criticize-policies.t $
5 # $Date: 2008-05-04 18:52:15 -0500 (Sun, 04 May 2008) $
8 ##############################################################################
10 # Extra self-compliance tests for Policies.
15 use English qw< -no_match_vars >;
21 use Perl::Critic::PolicyFactory ( '-test' => 1 );
23 #-----------------------------------------------------------------------------
25 eval { require Test::Perl::Critic; };
26 plan skip_all => 'Test::Perl::Critic required to criticise code' if $EVAL_ERROR;
28 #-----------------------------------------------------------------------------
30 # Set up PPI caching for speed (used primarily during development)
32 if ( $ENV{PERL_CRITIC_CACHE} ) {
37 "test-perl-critic-cache-$ENV{USER}"
39 if ( ! -d $cache_path) {
40 mkdir $cache_path, oct 700;
42 PPI::Cache->import( path => $cache_path );
45 #-----------------------------------------------------------------------------
46 # Run critic against all of our own files
48 my $rcfile = File::Spec->catfile( qw< xt author 41_perlcriticrc-policies > );
49 Test::Perl::Critic->import( -profile => $rcfile );
53 -e 'blib' ? 'blib/lib' : 'lib',
54 qw< Perl Critic Policy >,
56 all_critic_ok( $path );
58 #-----------------------------------------------------------------------------
62 # cperl-indent-level: 4
64 # indent-tabs-mode: nil
65 # c-indentation-style: bsd
67 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :