The following commit has been merged in the master branch:
commit cfdcbc8d4f423d542012f9c773a46e4f88eb8640
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Aug 23 22:59:28 2008 +0200

    t/runtests: Copy the changes to testset/runtests from JP's branch

diff --git a/debian/changelog b/debian/changelog
index 2bb0c55..688760b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ lintian (1.25.0) unstable; urgency=low
     dimensions (Severity and Certainty).
     The default output is unchanged, see the documentation on
     how to utilize the new features.
+  
+  * t/runtests:
+    + [FL] Copy the changes to testset/runtests from JP's branch.
 
  -- Frank Lichtenheld <[EMAIL PROTECTED]>  Sat, 23 Aug 2008 22:55:44 +0200
 
diff --git a/t/runtests b/t/runtests
index 1ac48c9..326df27 100755
--- a/t/runtests
+++ b/t/runtests
@@ -116,7 +116,8 @@ my $lintian_path = $LINTIAN_ROOT . "/frontend/lintian";
 
 my $testok = 0;
 my %tags;
-my %types = ( 'E' => 'error', 'W' => 'warning', 'I' => 'info', 'X' => 
'experimental' );
+my %severities = map { $_ => 1 } @Tags::severity_list;
+my %certainties = map { $_ => 1 } @Tags::certainty_list;
 
 # --- Display output immediately
 $| = 1;
@@ -162,21 +163,30 @@ for my $desc_file (<$LINTIAN_ROOT/checks/*.desc>) {
                    . " in $desc_file\n";
            }
 
-           if (!exists($i->{'type'}) && !exists($i->{'severity'})) {
-               use Data::Dumper;
-               print Dumper $i;
-               print "E: test-has-no-type $i->{'tag'} in $desc_file\n";
+           my $severity = $i->{'severity'};
+           my $certainty = $i->{'certainty'};
+           if ($severity and not exists $severities{$severity}) {
+               print "E: test-invalid-severity $severity in $desc_file\n";
+               $testok = 0;
+               next;
+           }
+           if ($certainty and not exists $certainties{$certainty}) {
+               print "E: test-invalid-certainty $certainty in $desc_file\n";
+               $testok = 0;
+               next;
+           }
+           if (not $severity or not $certainty) {
+               print "E: test-unclassified-tag $i->{'tag'} in $desc_file\n";
                $testok = 0;
                next;
            }
 
+           my $experimental = $i->{'experimental'};
+           my $code = Tags::get_tag_code($i);
+           $code = 'X' if $experimental and $experimental eq 'yes';
+
            $tags{$i->{'tag'}}{'desc_file'} = $desc_file;
-           if (exists $i->{'experimental'}) {
-               $tags{$i->{'tag'}}{'desc_type'} = "experimental";
-           } else {
-               $tags{$i->{'tag'}}{'desc_type'} = $i->{'type'} ||
-                   $Tags::sev_to_type[$i->{'severity'}];
-           }
+           $tags{$i->{'tag'}}{'desc_type'} = $code;
        }
     }
 }
@@ -304,7 +314,7 @@ for (@tests) {
            print "E: Invalid line:\n$_";
            next;
        }
-       $tags{$3}{'tested_type'} = $types{$1};
+       $tags{$3}{'tested_type'} = $1;
        $tags{$3}{'tested_package'} = $2;
     }
      close TAGS;

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to