[pkg-perl-tools] 07/09: syntax.t: allow listing more files to check in d/t/p/syntax-extra
Niko Tyni
ntyni at moszumanska.debian.org
Sat Dec 3 21:01:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
ntyni pushed a commit to branch ntyni/autopkgtest
in repository pkg-perl-tools.
commit 5dee603ecb8a1f16f6993f4668684aca974b28f7
Author: Niko Tyni <ntyni at debian.org>
Date: Sun Nov 27 21:46:54 2016 +0200
syntax.t: allow listing more files to check in d/t/p/syntax-extra
We differentiate between .pm files that are on @INC and "extra" files
that don't need to be.
Closes: #796040
---
autopkgtest/README.autopkgtest | 6 ++++++
.../scripts/runtime-deps-and-recommends.d/syntax.t | 19 +++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/autopkgtest/README.autopkgtest b/autopkgtest/README.autopkgtest
index 63677d2..ea73dd4 100644
--- a/autopkgtest/README.autopkgtest
+++ b/autopkgtest/README.autopkgtest
@@ -50,6 +50,12 @@ by adding them to 'debian/tests/pkg-perl/syntax-skip'. The lines are
matched as fixed substrings (not regular expressions.) Empty lines and
#-style comments are supported.
+If there are additional files besides those matching '/\.pm$/'
+that you'd like to check, you can specify a list of those in
+'debian/tests/pkg-perl/syntax-extra'. The lines are matched as regular
+expressions; don't include the match delimiters (//). Empty lines and
+#-style comments are supported.
+
The environment variables AUTOMATED_TESTING=1 and NONINTERACTIVE_TESTING=1
are set by default for the smoke test. You can override these and add
others in 'debian/tests/pkg-perl/smoke-env'.
diff --git a/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t b/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t
index d2c5ff3..0c2903d 100755
--- a/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t
+++ b/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t
@@ -38,6 +38,12 @@ sub readskip {
readfile($skip);
}
+sub readextra {
+ my $file = 'debian/tests/pkg-perl/syntax-extra';
+ -r $file or return ();
+ readfile($file);
+}
+
sub readfile {
my $file = shift;
open (S, '<', $file)
@@ -60,6 +66,8 @@ usage() if !@packages;
plan tests => 4 * scalar @packages;
+my @extra_check = readextra();
+
my @to_skip = readskip();
for my $package (@packages) {
@@ -84,7 +92,13 @@ for my $package (@packages) {
F: for (@files) {
next if !m{^/}; # skip diversions
chomp;
- next if !/\.pm$/;
+
+ my $is_extra = 0;
+ for my $check_re (@extra_check) {
+ $is_extra++, last if /$check_re/;
+ }
+ next if !/\.pm$/ and !$is_extra;
+
for my $skip_re (@to_skip) {
note "skipping $_", next F if /$skip_re/;
}
@@ -92,7 +106,8 @@ for my $package (@packages) {
for my $incdir (@INC) {
$oninc++, last if /^\Q$incdir/;
}
- next if !$oninc;
+ # 'extra files' don't need to be on @INC
+ next if !$oninc and !$is_extra;
push @pms, $_;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git
More information about the Pkg-perl-cvs-commits
mailing list