[SCM] Debian package checker branch, master, updated. 2.1.3-9-g1bd2c3a
The following commit has been merged in the master branch:
commit b6ba283bf8a67c03fb2afcdaff3462ab666c19f9
Author: Russ Allbery <rra@debian.org>
Date: Sun Dec 28 21:00:23 2008 -0800
Verify Test-For and Test-Against in the new test suite
* t/runtests:
+ [RA] Check that a test produces all tags listed in Test-For and
doesn't produce any tages listed in Test-Against.
diff --git a/debian/changelog b/debian/changelog
index 204d326..d16a39d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,10 @@ lintian (2.1.4) UNRELEASED; urgency=low
- unusual-control-interpreter is certain, not possible.
- Suppress some cases of multiple tags about the same basic problem.
+ * t/runtests:
+ + [RA] Check that a test produces all tags listed in Test-For and
+ doesn't produce any tages listed in Test-Against.
+
-- Russ Allbery <rra@debian.org> Sun, 28 Dec 2008 13:02:03 -0800
lintian (2.1.3) unstable; urgency=low
diff --git a/t/runtests b/t/runtests
index cff0c36..88acced 100755
--- a/t/runtests
+++ b/t/runtests
@@ -194,6 +194,10 @@ for (@tests) {
next;
}
+ # Check the output for invalid lines. Also verify that all Test-For tags
+ # are seen and all Test-Against tags are not.
+ my %test_for = map { $_ => 1 } split(' ', $testdata->{'test-for'});
+ my %test_against = map { $_ => 1 } split(' ', $testdata->{'test-against'});
open TAGS, "$rundir/tags.$pkg" or fail("Cannot open $rundir/tags.$pkg");
while (<TAGS>) {
next if m/^N: /;
@@ -201,8 +205,18 @@ for (@tests) {
print "E: Invalid line:\n$_";
next;
}
+ my $tag = $3;
+ if ($test_against{$tag}) {
+ print "E: Tag $tag seen but listed in Test-Against\n";
+ }
+ delete $test_for{$tag};
}
close TAGS;
+ if (%test_for) {
+ for my $tag (sort keys %test_for) {
+ print "E: Tag $tag listed in Test-For but not found\n";
+ }
+ }
}
if (!$tests_run) {
@@ -261,6 +275,9 @@ sub check_test_is_sane {
$data->{architecture} ||= 'all';
$data->{section} ||= 'devel';
+ $data->{'test-for'} ||= '';
+ $data->{'test-against'} ||= '';
+
if ($debug) {
print "check_test_is_sane => ".Dumper($data);
}
--
Debian package checker
Reply to: