[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: c/testsuite.pm: Recognise autopkgtest-pkg-{perl, ruby}



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit f4b93cfee5e0cc4daa536f3460495b7e72acccf4
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Oct 2 19:20:39 2014 +0200

    c/testsuite.pm: Recognise autopkgtest-pkg-{perl,ruby}
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/testsuite.pm                  | 20 +++++++++++++++-----
 debian/changelog                     |  5 +++++
 t/tests/testsuite-unknown-suite/tags |  2 +-
 3 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/checks/testsuite.pm b/checks/testsuite.pm
index 64ea156..d5368d4 100644
--- a/checks/testsuite.pm
+++ b/checks/testsuite.pm
@@ -54,16 +54,26 @@ my %KNOWN_RESTRICTIONS = map { $_ => 1 } qw(
   rw-build-tree
 );
 
+my %KNOWN_TESTSUITES = map { $_ => 1 } qw(
+  autopkgtest
+  autopkgtest-pkg-perl
+  autopkgtest-pkg-ruby
+);
+
 sub run {
     my ($pkg, $type, $info) = @_;
-    my $testsuite = $info->field('testsuite');
+    my $testsuites = $info->field('testsuite', '');
     my $control = $info->index('debian/tests/control');
+    my $needs_control = 0;
 
-    if (defined($testsuite) xor defined($control)) {
-        tag 'inconsistent-testsuite-field';
+    for my $testsuite (split(m/\s*,\s*/o, $testsuites)) {
+        if (not exists($KNOWN_TESTSUITES{$testsuite})) {
+            tag 'unknown-testsuite', $testsuite;
+        }
+        $needs_control = 1 if $testsuite eq 'autopkgtest';
     }
-    if (defined($testsuite) and $testsuite ne 'autopkgtest') {
-        tag 'unknown-testsuite', $testsuite;
+    if ($needs_control xor defined($control)) {
+        tag 'inconsistent-testsuite-field';
     }
 
     if (defined($control)) {
diff --git a/debian/changelog b/debian/changelog
index 27fd180..9d2746a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,11 @@ lintian (2.5.28) UNRELEASED; urgency=medium
   * checks/po-debconf.pm:
     + [NT] Avoid writing test.pot to the unpacked package.
       (Closes: #699022)
+  * checks/testsuite.pm:
+    + [NT] Recognise autopkgtest-pkg-{perl,ruby} values for
+      the "Testsuite" field.  Extended validation is not
+      implemented though.  Thanks to Niko Tyni for reporting
+      the issue.  (Closes: #762177)
 
   * collection/*:
     + [NT] Remove all uses of "debfiles" and "control".
diff --git a/t/tests/testsuite-unknown-suite/tags b/t/tests/testsuite-unknown-suite/tags
index 1ca5cbe..1bfdd04 100644
--- a/t/tests/testsuite-unknown-suite/tags
+++ b/t/tests/testsuite-unknown-suite/tags
@@ -1 +1 @@
-W: testsuite-unknown-suite source: unknown-testsuite autopkgtest, golf
+W: testsuite-unknown-suite source: unknown-testsuite golf

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: