summaryrefslogtreecommitdiffstats
path: root/t/syntax/syntax-progs.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:53:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:53:53 +0000
commit90169463f86997737ed5b9c0ea2b311cd3b056b7 (patch)
tree281a0f8d9850ea58cf2a3ddb8bf087fb52520925 /t/syntax/syntax-progs.t
parentInitial commit. (diff)
downloaddebhelper-upstream/13.15.3.tar.xz
debhelper-upstream/13.15.3.zip
Adding upstream version 13.15.3.upstream/13.15.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/syntax/syntax-progs.t')
-rwxr-xr-xt/syntax/syntax-progs.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/syntax/syntax-progs.t b/t/syntax/syntax-progs.t
new file mode 100755
index 0000000..93d00bb
--- /dev/null
+++ b/t/syntax/syntax-progs.t
@@ -0,0 +1,28 @@
+#!/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;
+
+use Config;
+my $binpath = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '.';
+my $libpath = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : 'lib';
+
+my @targets;
+if ($0 =~ m{syntax-progs\.t$}) {
+ @targets = grep { -x $_ } glob("$binpath/dh_*"), "$binpath/dh";
+} else {
+ @targets = (glob("$libpath/Debian/Debhelper/*.pm"), glob("$libpath/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");
+}
+