summaryrefslogtreecommitdiff
path: root/t/syntax/syntax-progs.t
blob: 0dbdb2a2b84f5bd2a6619b5d5d012d018ac8df26 (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
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;

use File::Basename qw(dirname);
use lib dirname(dirname(__FILE__));
# Need Test::More to set PERL5LIB
use Test::DH;

my @targets;
if ($0 =~ m{syntax-progs\.t$}) {
	@targets = grep { -x $_ } glob("dh_*"), "dh";
} else {
	@targets = (glob("Debian/Debhelper/*.pm"), glob("Debian/Debhelper/*/*.pm"));
}

plan(tests => scalar(@targets));

foreach my $file (@targets) {
	is(system("perl -c $file >/dev/null 2>&1"), 0)
	  or diag("$file failed syntax check");
}