[debhelper-devel] [debhelper] 05/30: t/syntax.t: Make it run without setting PERL5LIB
Niels Thykier
nthykier at moszumanska.debian.org
Mon Jul 3 14:40:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 7de6ea56113fcf133cb1d25ac2f8cc40b7b0da0d
Author: Niels Thykier <niels at thykier.net>
Date: Sun Jul 2 10:20:26 2017 +0000
t/syntax.t: Make it run without setting PERL5LIB
Signed-off-by: Niels Thykier <niels at thykier.net>
---
t/syntax.t | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/t/syntax.t b/t/syntax.t
index fb1d9c0..aa70a1b 100755
--- a/t/syntax.t
+++ b/t/syntax.t
@@ -1,5 +1,12 @@
#!/usr/bin/perl
-use Test;
+use strict;
+use warnings;
+use Test::More;
+
+use File::Basename qw(dirname);
+use lib dirname(__FILE__);
+# Need Test::More to set PERL5LIB
+use Test::DH;
my @progs=grep { -x $_ } glob("dh_*"), "dh";
my @libs=(glob("Debian/Debhelper/*.pm"), glob("Debian/Debhelper/*/*.pm"));
@@ -7,9 +14,8 @@ my @libs=(glob("Debian/Debhelper/*.pm"), glob("Debian/Debhelper/*/*.pm"));
plan(tests => (@progs + @libs));
foreach my $file (@progs, @libs) {
- print "# Testing $file\n";
- ok(system("perl -c $file >/dev/null 2>&1"), 0)
- or print STDERR "# Testing $file is broken\n";
+ is(system("perl -c $file >/dev/null 2>&1"), 0)
+ or diag("$file failed syntax check");
}
# Local Variables:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list