summaryrefslogtreecommitdiffstats
path: root/t/014critic-core.t
blob: fb3bc279c46803e813e732fabe433f8fd306e965 (plain)
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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.

# Enforce high standards against code that will be installed

use 5.14.0;
use strict;
use warnings;

use lib qw(. lib local/lib/perl5 t);

use Test::More;
use File::Spec::Functions ':ALL';

BEGIN {
    # Don't run tests for installs or automated tests
    unless ( $ENV{RELEASE_TESTING} ) {
        plan( skip_all => "Author tests not required for installation" );
    }
    my $config = catfile('t', 'critic-core.ini');
    unless ( eval "use Test::Perl::Critic -profile => '$config'; 1" ) {
        plan skip_all => 'Test::Perl::Critic required to criticise code';
    }
}

# need to skip t/
all_critic_ok(
    'Bugzilla.pm',
    'Bugzilla/',
    glob("*.cgi"),
    glob("*.pl"),
);