diff options
author | Dylan Hardison <dylan@mozilla.com> | 2016-01-27 23:37:21 +0100 |
---|---|---|
committer | Dylan Hardison <dylan@mozilla.com> | 2016-01-27 23:39:00 +0100 |
commit | a0f345b36eda134a8483be13fe75307f20809c54 (patch) | |
tree | 88fa276993693c43d931f79a98218a3232dcb4a3 /t/014critic-core.t | |
parent | 39d8526e3b986f42cce3d476319051238d5424e7 (diff) | |
download | bugzilla-a0f345b36eda134a8483be13fe75307f20809c54.tar.gz bugzilla-a0f345b36eda134a8483be13fe75307f20809c54.tar.xz |
Bug 555438 - Improve the Bugzilla code base using Perl::Critic
r=dkl,a=dylan
Diffstat (limited to 't/014critic-core.t')
-rw-r--r-- | t/014critic-core.t | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/014critic-core.t b/t/014critic-core.t new file mode 100644 index 000000000..e38e64210 --- /dev/null +++ b/t/014critic-core.t @@ -0,0 +1,33 @@ +# 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.10.1; +use strict; +use warnings; +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"), +); |