File: critic.t

package info (click to toggle)
javatools 0.48%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 416 kB
  • ctags: 72
  • sloc: sh: 1,515; perl: 930; makefile: 35
file content (35 lines) | stat: -rwxr-xr-x 658 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl

use strict;
use warnings;
use autodie;

use Test::More;

plan skip_all => 'Only UNRELEASED versions are criticised'
    if should_skip();

eval 'use Test::Perl::Critic 1.00';
plan skip_all => 'Test::Perl::Critic 1.00 required to run this test' if $@;

eval 'use PPIx::Regexp';
diag('libppix-regexp-perl is needed to enable some checks') if $@;

Test::Perl::Critic->import( -profile => '.perlcriticrc' );

all_critic_ok('.');
done_testing;

sub should_skip {
    my $skip = 1;

    open(my $fd, '-|', 'dpkg-parsechangelog', '-c0');

    while (<$fd>) {
	$skip = 0 if m/^Distribution: UNRELEASED$/;
    }

    close($fd);

    return $skip;
}