The following commit has been merged in the master branch:
commit 0024ba7118d19df516d44a053d36bf8e9b2e5129
Author: Jordà Polo <[EMAIL PROTECTED]>
Date:   Wed Jul 9 19:58:35 2008 +0200

    Convert tests to Severity/Certainty classification

diff --git a/testset/runtests b/testset/runtests
index 9a5bd16..f02ef07 100755
--- a/testset/runtests
+++ b/testset/runtests
@@ -125,7 +125,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;
@@ -171,20 +172,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{$i->{'tag'}}{'desc_type'} = $code;
        }
     }
 }
@@ -294,7 +305,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