[debhelper-devel] [debhelper] 24/30: t: Split syntax check test
Niels Thykier
nthykier at moszumanska.debian.org
Mon Jul 3 14:40:38 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 72f3cd70a408559eaea13d5520b560b9fe905973
Author: Niels Thykier <niels at thykier.net>
Date: Mon Jul 3 11:01:40 2017 +0000
t: Split syntax check test
Signed-off-by: Niels Thykier <niels at thykier.net>
---
t/syntax/syntax-libs.t | 1 +
t/{syntax.t => syntax/syntax-progs.t} | 14 +++++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/t/syntax/syntax-libs.t b/t/syntax/syntax-libs.t
new file mode 120000
index 0000000..fedf32e
--- /dev/null
+++ b/t/syntax/syntax-libs.t
@@ -0,0 +1 @@
+syntax-progs.t
\ No newline at end of file
diff --git a/t/syntax.t b/t/syntax/syntax-progs.t
similarity index 53%
rename from t/syntax.t
rename to t/syntax/syntax-progs.t
index aa70a1b..37ece05 100755
--- a/t/syntax.t
+++ b/t/syntax/syntax-progs.t
@@ -4,16 +4,20 @@ use warnings;
use Test::More;
use File::Basename qw(dirname);
-use lib dirname(__FILE__);
+use lib dirname(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"));
+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 => (@progs + @libs));
+plan(tests => scalar(@targets));
-foreach my $file (@progs, @libs) {
+foreach my $file (@targets) {
is(system("perl -c $file >/dev/null 2>&1"), 0)
or diag("$file failed syntax check");
}
--
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