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

[SCM] Debian package checker branch, master, updated. 2.5.11-212-g33deb0b



The following commit has been merged in the master branch:
commit 33deb0b76cb17ce59e0c064c665777442c33953c
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Apr 2 17:52:57 2013 +0200

    t: Apply critic to test scripts
    
    ... except perl code in actual test cases.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/helpers/bin/create-deb b/t/helpers/bin/create-deb
index f8d7a4e..8039c6e 100755
--- a/t/helpers/bin/create-deb
+++ b/t/helpers/bin/create-deb
@@ -25,6 +25,7 @@ use warnings;
 
 use Getopt::Long;
 use Cwd();
+use List::MoreUtils qw(any);
 
 use lib "$ENV{'LINTIAN_ROOT'}/lib";
 use Lintian::Util qw(get_dsc_info);
@@ -89,7 +90,7 @@ if ($val{'auto-build-data'}) {
 }
 
 # default to "on" unless we are given an md5sums file explicitly
-$val{'md5sums'} = 1 unless defined $val{'md5sums'} || grep { $_ eq 'md5sums'} @ARGV;
+$val{'md5sums'} = 1 unless defined $val{'md5sums'} || any { $_ eq 'md5sums'} @ARGV;
 
 $cwd = Cwd::cwd();
 
diff --git a/t/helpers/bin/subst-dsc b/t/helpers/bin/subst-dsc
index da77fe0..bd768dd 100755
--- a/t/helpers/bin/subst-dsc
+++ b/t/helpers/bin/subst-dsc
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use lib "$ENV{'LINTIAN_ROOT'}/lib";
 use Lintian::Util qw(get_file_checksum);
@@ -9,9 +10,9 @@ my ($size, $sha1, $sha2, $md5);
 my ($tarfile) = @ARGV;
 
 $size = (stat $tarfile)[7];
-$sha1 = get_file_checksum ("sha1", $tarfile);
-$sha2 = get_file_checksum ("sha256", $tarfile);
-$md5  = get_file_checksum ("md5", $tarfile);
+$sha1 = get_file_checksum ('sha1', $tarfile);
+$sha2 = get_file_checksum ('sha256', $tarfile);
+$md5  = get_file_checksum ('md5', $tarfile);
 
 while ( <STDIN> ) {
     s/\@SIZE\@/$size/g;
diff --git a/t/runtests b/t/runtests
index 2f98ba3..1c65562 100755
--- a/t/runtests
+++ b/t/runtests
@@ -36,6 +36,7 @@ use Thread::Queue;
 
 use Data::Dumper;
 use Getopt::Long qw(GetOptions);
+use List::MoreUtils qw(none);
 use Text::Template;
 
 use constant SUITES => qw(scripts changes debs source tests);
@@ -264,7 +265,7 @@ if ($singletest) {
     unless (-d "$TESTSET/changes") {
         fail("cannot find $TESTSET/changes: $!");
     }
-    @tests = map { read_dpkg_control($_) } sort(<$TESTSET/changes/*.desc>);
+    @tests = map { read_dpkg_control($_) } sort(glob("$TESTSET/changes/*.desc"));
 }
 print "Found the following changes tests: @tests\n" if $DEBUG;
 print "Changes tests:\n" if @tests;
@@ -480,7 +481,6 @@ sub run_lintian {
     my $status = 0;
     my @options = split(' ', $testdata->{options}//'');
     my $cmd;
-    my $ret;
     unshift @options, '--allow-root', '--no-cfg', '--no-user-dirs';
     unshift(@options, '--profile', $testdata->{profile}) if $testdata->{profile};
     my $pid = open my $in, '-|';
@@ -527,7 +527,7 @@ sub test_changes {
     # Check if we need to copy these files over.
     if ( ! -e $file && -e "$file.in" ) {
         my @files;
-        msg_print "building... ";
+        msg_print 'building... ';
         # copy all files but "tags" and desc.  Usually this will only
         # be ".changes.in", but in rare cases we have "other files"
         # as well.
@@ -905,7 +905,8 @@ sub check_test_is_sane {
     push @architectures, $ARCHITECTURE;
 
     # Check for arch-specific tests
-    if (!grep { $data->{architecture} =~ m/\b$_\b/ } @architectures) {
+    # FIXME: deal with wildcards correctly.
+    if (none { $data->{architecture} =~ m/\b$_\b/ } @architectures) {
         return 0;
     }
 
diff --git a/t/scripts/Lintian/Command/Simple/02-background.t b/t/scripts/Lintian/Command/Simple/02-background.t
index 342bee7..85032b9 100644
--- a/t/scripts/Lintian/Command/Simple/02-background.t
+++ b/t/scripts/Lintian/Command/Simple/02-background.t
@@ -9,6 +9,6 @@ use Lintian::Command::Simple qw(background);
 my $pid = background ('true');
 cmp_ok($pid, '>', 0, 'Basic background (true)');
 
-is(waitpid($pid, 0), $pid, "Waiting for pid");
-is($?, 0, "Return status is 0");
+is(waitpid($pid, 0), $pid, 'Waiting for pid');
+is($?, 0, 'Return status is 0');
 
diff --git a/t/scripts/Lintian/Command/Simple/03-multiple-jobs.t b/t/scripts/Lintian/Command/Simple/03-multiple-jobs.t
index 0cefb02..ebd32c8 100644
--- a/t/scripts/Lintian/Command/Simple/03-multiple-jobs.t
+++ b/t/scripts/Lintian/Command/Simple/03-multiple-jobs.t
@@ -6,7 +6,6 @@ use Test::More tests => 22;
 
 use Lintian::Command::Simple qw(background wait_any);
 
-my $cmd;
 my $c = 4;
 my %jobs;
 
@@ -22,7 +21,7 @@ while ( my $value = wait_any (\%jobs)) {
     $c++;
 }
 
-is($c, 4, "4 jobs were started, 4 reaped");
+is($c, 4, '4 jobs were started, 4 reaped');
 
 # again, but in list context
 
@@ -38,13 +37,13 @@ while ( my ($pid, $value) = wait_any (\%jobs)) {
     $c++;
 }
 
-is($c, 4, "4 more jobs were started, 4 reaped");
+is($c, 4, '4 more jobs were started, 4 reaped');
 
 # Make sure the case of an empty hash is handled properly
 # (i.e. undef is returned and no process is reaped)
 
 %jobs = ();
-my $pid = background("true");
+my $pid = background('true');
 is (wait_any (\%jobs), undef, 'With an empty hash ref, wait() returns undef');
 
 is (my @list = wait_any (\%jobs), 0,
diff --git a/t/scripts/Lintian/DepMap/01add-select-satisfy.t b/t/scripts/Lintian/DepMap/01add-select-satisfy.t
index 0508632..fc4d0fa 100644
--- a/t/scripts/Lintian/DepMap/01add-select-satisfy.t
+++ b/t/scripts/Lintian/DepMap/01add-select-satisfy.t
@@ -12,26 +12,26 @@ ok(eval { $map = Lintian::DepMap->new(); }, 'Create');
 
 is_deeply([ $map->selectable() ], [], 'Empty, nothing is selectable');
 is_deeply([ $map->selected() ], [], 'Empty, nothing has been selected');
-ok($map->pending() eq 0, 'Empty, nothing is pending');
+ok($map->pending() == 0, 'Empty, nothing is pending');
 is_deeply([ $map->known() ], [], 'Empty, nothing is known');
 is_deeply([ $map->missing() ], [], 'Empty, nothing is missing');
 
 ok(eval { $map->add('A'); }, 'Add A');
 is_deeply([ $map->selectable() ], ['A'], 'A is selectable');
-ok($map->pending() eq 1, 'A is pending');
+ok($map->pending() == 1, 'A is pending');
 is_deeply([ $map->known() ], ['A'], 'A added, it is known');
 is_deeply([ $map->missing() ], [], 'A added, it is not missing');
 
 ok(eval { $map->select('A'); }, 'Select A');
 is_deeply([ $map->selectable() ], [], 'A selected, nothing is selectable');
 ok($map->selected('A'), 'A selected, A has been selected');
-ok($map->pending() eq 1, 'A selected, A is still pending');
+ok($map->pending() == 1, 'A selected, A is still pending');
 is_deeply([ $map->known() ], ['A'], 'A selected, it is known');
 is_deeply([ $map->missing() ], [], 'A selected, nothing is missing');
 
 ok(eval { $map->satisfy('A'); }, 'Satisfy A');
 is_deeply([ $map->selectable() ], [], 'A satisfied, nothing is selectable');
 is_deeply([ $map->selected() ], [], 'A satisfied, nothing is selected');
-ok($map->pending() eq 0, 'A satisfied, nothing is pending');
+ok($map->pending() == 0, 'A satisfied, nothing is pending');
 is_deeply([ $map->known() ], ['A'], 'A satisfied, it is known');
 is_deeply([ $map->missing() ], [], 'A satisfied, nothing is missing');
diff --git a/t/scripts/Lintian/DepMap/04satisfiability.t b/t/scripts/Lintian/DepMap/04satisfiability.t
index 5fe70c7..e61edaf 100644
--- a/t/scripts/Lintian/DepMap/04satisfiability.t
+++ b/t/scripts/Lintian/DepMap/04satisfiability.t
@@ -1,18 +1,19 @@
 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
 use Test::More tests => 4;
 
 use Lintian::DepMap;
 
 my $obj = Lintian::DepMap->new();
 
-ok($obj->add('A', 'B'), "Nodes can be added in any order");
+ok($obj->add('A', 'B'), 'Nodes can be added in any order');
 
 eval {$obj->satisfy('Z')};
-isnt($@, '', "Nodes that were not added can not be satisfied");
+isnt($@, '', 'Nodes that were not added can not be satisfied');
 
 eval {$obj->satisfy('B')};
-isnt($@, '', "Nodes that were not added and are missing() can not be satisfied");
+isnt($@, '', 'Nodes that were not added and are missing() can not be satisfied');
 
-ok(!$obj->satisfy('A'), "Nodes can not be satisfied if they still have dependencies");
+ok(!$obj->satisfy('A'), 'Nodes can not be satisfied if they still have dependencies');
diff --git a/t/scripts/Lintian/DepMap/08initialise.t b/t/scripts/Lintian/DepMap/08initialise.t
index 36221e6..4d6884c 100644
--- a/t/scripts/Lintian/DepMap/08initialise.t
+++ b/t/scripts/Lintian/DepMap/08initialise.t
@@ -1,38 +1,39 @@
 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
 use Test::More tests => 7;
 
 use Lintian::DepMap;
 
 my $obj = Lintian::DepMap->new();
 
-ok($obj->initialise(), "Map can be initialised");
+ok($obj->initialise(), 'Map can be initialised');
 
 $obj->add('A');
 $obj->select('A');
 $obj->initialise();
 is(join(', ', $obj->selectable()), 'A',
-    "A is selectable once again after being selected");
+    'A is selectable once again after being selected');
 
 $obj->satisfy('A');
 $obj->initialise();
 is(join(', ', $obj->selectable()), 'A',
-    "A is selectable once again after being satisfied");
+    'A is selectable once again after being satisfied');
 
 $obj->add('B');
 $obj->satisfy('B');
 $obj->initialise();
 is(join(', ', $obj->selectable()), 'A, B',
-    "A and B are selectable once again after being satisfied");
+    'A and B are selectable once again after being satisfied');
 
 $obj->add('B', 'A');
 $obj->satisfy('A');
 $obj->initialise();
 is(join(', ', $obj->parents('B')), 'A',
-    "A is parent of B");
+    'A is parent of B');
 
 $obj->add('Z', 'X');
 $obj->initialise();
-is(join(', ', $obj->missing()), 'X', "X is unknown");
-is(join(', ', sort($obj->known())), 'A, B, Z', "X is not known");
+is(join(', ', $obj->missing()), 'X', 'X is unknown');
+is(join(', ', sort($obj->known())), 'A, B, Z', 'X is not known');
diff --git a/t/scripts/Lintian/DepMap/08initialise2.t b/t/scripts/Lintian/DepMap/08initialise2.t
index be1caba..acff702 100644
--- a/t/scripts/Lintian/DepMap/08initialise2.t
+++ b/t/scripts/Lintian/DepMap/08initialise2.t
@@ -1,6 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
 use Test::More tests => 2;
 
 use Lintian::DepMap;
@@ -14,8 +15,8 @@ $obj->add('B', 'A');
 $obj->satisfy('A');
 $obj->initialise();
 is(join(', ', $obj->selectable()), 'A',
-    "Only A is selectable after reinitialising");
+    'Only A is selectable after reinitialising');
 
 $obj->satisfy('A');
 is(join(', ', $obj->selectable()), 'B',
-    "B is selectable after A has been satisfied");
+    'B is selectable after A has been satisfied');
diff --git a/t/scripts/Lintian/DepMap/09unlink.t b/t/scripts/Lintian/DepMap/09unlink.t
index 68eacda..33d4a08 100644
--- a/t/scripts/Lintian/DepMap/09unlink.t
+++ b/t/scripts/Lintian/DepMap/09unlink.t
@@ -47,5 +47,5 @@ TODO: {
     local $TODO = 'When re-adding B there are still references to the old B, and old $B != new $B';
     $map->add('B');
     $map->satisfy('B');
-    ok(eval {$map->satisfy('A')}, "B re-added, A can be satisfied");
+    ok(eval {$map->satisfy('A')}, 'B re-added, A can be satisfied');
 }
diff --git a/t/scripts/Lintian/DepMap/10circular.t b/t/scripts/Lintian/DepMap/10circular.t
index 68a3591..0382700 100644
--- a/t/scripts/Lintian/DepMap/10circular.t
+++ b/t/scripts/Lintian/DepMap/10circular.t
@@ -30,7 +30,7 @@ TODO: {
     # We break the circular dependency:
     $map->unlink('C');
     is(join(', ', $map->circular('deep')), '', 'Deep circular dependency is now broken (w/o C)');
-    
+
     $map->add('C');
     is(join(', ', $map->circular('deep')), '', 'C re-added, circular dependency still broken');
-}
\ No newline at end of file
+}
diff --git a/t/scripts/Lintian/DepMap/11prefix.t b/t/scripts/Lintian/DepMap/11prefix.t
index b70ebf1..3dabf4a 100644
--- a/t/scripts/Lintian/DepMap/11prefix.t
+++ b/t/scripts/Lintian/DepMap/11prefix.t
@@ -10,8 +10,8 @@ my $map = Lintian::DepMap->new();
 
 $map->add('pA');
 $map->add('pB', 'pA');
-ok( eval {$map->addp('foo', 'p', 'A')}, "Add foo depending on 'p'+'A'");
+ok( eval {$map->addp('foo', 'p', 'A')}, 'Add foo depending on "p"+"A"');
 
 $map->satisfy('pA');
 
-ok($map->selectable('foo'), "foo is selectable");
+ok($map->selectable('foo'), 'foo is selectable');
diff --git a/t/scripts/Lintian/DepMap/12done.t b/t/scripts/Lintian/DepMap/12done.t
index 3287aae..07467c6 100644
--- a/t/scripts/Lintian/DepMap/12done.t
+++ b/t/scripts/Lintian/DepMap/12done.t
@@ -1,6 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
 use Test::More tests => 4;
 
 use Lintian::DepMap;
@@ -8,12 +9,12 @@ use Lintian::DepMap;
 my $obj = Lintian::DepMap->new();
 
 $obj->add('A');
-ok(!$obj->done('A'), "A is not done yet");
-ok(!$obj->done('B'), "B is not done yet");
+ok(!$obj->done('A'), 'A is not done yet');
+ok(!$obj->done('B'), 'B is not done yet');
 
 $obj->select('A');
-ok(!$obj->done('A'), "A is still not done");
+ok(!$obj->done('A'), 'A is still not done');
 
 $obj->satisfy('A');
-ok($obj->done('A'), "A is finally done");
+ok($obj->done('A'), 'A is finally done');
 
diff --git a/t/scripts/Lintian/DepMap/Properties/00construct.t b/t/scripts/Lintian/DepMap/Properties/00construct.t
index ed8fad8..46b75ac 100644
--- a/t/scripts/Lintian/DepMap/Properties/00construct.t
+++ b/t/scripts/Lintian/DepMap/Properties/00construct.t
@@ -13,12 +13,12 @@ ok(eval { $map = Lintian::DepMap::Properties->new(); }, 'Create');
 
 my %prop = (name => 'John Doe', age => 20);
 
-ok($map->add('P1', \%prop), "Add node with properties as a hash");
+ok($map->add('P1', \%prop), 'Add node with properties as a hash');
 
-is_deeply($map->getp('P1'), \%prop, "Properties are preserved");
+is_deeply($map->getp('P1'), \%prop, 'Properties are preserved');
 
-ok($map->add('P2', 'P1'), "Nodes can be added without properties");
+ok($map->add('P2', 'P1'), 'Nodes can be added without properties');
 
-ok(eval {$map->satisfy('P1');}, "Nodes can be satisfied");
+ok(eval {$map->satisfy('P1');}, 'Nodes can be satisfied');
 
-ok($map->addp('foo', 'P', '1', '2', {name => 'test'}), "Nodes can be added with prefix");
+ok($map->addp('foo', 'P', '1', '2', {name => 'test'}), 'Nodes can be added with prefix');
diff --git a/t/scripts/Lintian/Lab/Manifest/01-basic.t b/t/scripts/Lintian/Lab/Manifest/01-basic.t
index 7015b21..0eba376 100644
--- a/t/scripts/Lintian/Lab/Manifest/01-basic.t
+++ b/t/scripts/Lintian/Lab/Manifest/01-basic.t
@@ -25,17 +25,17 @@ $plist->set ($input);
 # Collect all entries and their keys
 $plist->visit_all (sub { my ($v, @k) = @_; push @contents, $v; push @keys, \@k} );
 
-is(@contents, 1, "Contents one element");
-is($contents[0]->{'source'}, $input->{'source'}, "Element has the right name");
+is(@contents, 1, 'Contents one element');
+is($contents[0]->{'source'}, $input->{'source'}, 'Element has the right name');
 
 # Change input, output should be unaffected
-$input->{'file'} = "lalalala";
+$input->{'file'} = 'lalalala';
 
 $output = $plist->get (@{ $keys[0] });
 
-ok($output, "get returns a defined object");
-is($output->{'source'}, $input->{'source'}, "Input{source} eq Output{source}");
+ok($output, 'get returns a defined object');
+is($output->{'source'}, $input->{'source'}, 'Input{source} eq Output{source}');
 
-isnt($output->{'random-field'}, "Output contains random-field");
-is($output->{'file'}, $orig_file, "Output{file} is unaffected by modification");
+isnt($output->{'random-field'}, 'Output contains random-field');
+is($output->{'file'}, $orig_file, 'Output{file} is unaffected by modification');
 
diff --git a/t/scripts/Lintian/Lab/Manifest/02-io.t b/t/scripts/Lintian/Lab/Manifest/02-io.t
index 50939fb..eebf18c 100644
--- a/t/scripts/Lintian/Lab/Manifest/02-io.t
+++ b/t/scripts/Lintian/Lab/Manifest/02-io.t
@@ -29,7 +29,7 @@ my $inmemdata;
 
 $plist->visit_all (sub { push @all, $_[1] });
 
-is( @all, 3, "Read 3 elements from the data file");
+is( @all, 3, 'Read 3 elements from the data file');
 for ( my $i = 0; $i < scalar @all; $i++) {
     my $no = $i + 1;
     is($all[$i], "pkg$no", "Element $no is pkg$no");
@@ -39,7 +39,7 @@ ok( eval {
     $plist->write_list(\$inmemdata);
     $olist->read_list(\$inmemdata);
     1;
-}, "Wrote and read the data");
+}, 'Wrote and read the data');
 
 SKIP: {
     my @pkeys;
@@ -53,7 +53,7 @@ SKIP: {
     }
     $plist->visit_all ($pv);
     $olist->visit_all ($ov);
-    is_deeply(\@pval, \@oval, "The lists contents the same elements");
+    is_deeply(\@pval, \@oval, 'The lists contents the same elements');
     for ( my $i = 0 ; $i < scalar @pkeys ; $i++) {
         my $no = $i + 1;
         my $e  = $plist->get (@{ $pkeys[$i] });
diff --git a/t/scripts/Lintian/Lab/repair.t b/t/scripts/Lintian/Lab/repair.t
index 04b9dff..f7b73f9 100755
--- a/t/scripts/Lintian/Lab/repair.t
+++ b/t/scripts/Lintian/Lab/repair.t
@@ -36,7 +36,7 @@ $err = $@ if $@;
 $LAB_A->remove if $LAB_A->exists;
 $LAB_B->remove if $LAB_B->exists;
 
-is ($err, undef, "Test had no errors");
+is ($err, undef, 'Test had no errors');
 
 exit 0;
 
@@ -103,7 +103,7 @@ sub do_tests {
     $diff = $full_manifest->diff ($LAB_A->_get_lab_index ('changes'));
     cmp_ok (scalar @{ $diff->added }, '==', 0, 'Lab A (broken): Nothing new appeared with repair');
     TODO: {
-        local $TODO = "Restoration not implemented yet";
+        local $TODO = 'Restoration not implemented yet';
         cmp_ok (scalar @{ $diff->removed }, '==', 0, 'Lab A (broken): Nothing disappeared with repair');
     }
     # Currently nothing changes (no pun intended) when repairing; it might in the
diff --git a/t/scripts/Lintian/Relation/04-multiarch.t b/t/scripts/Lintian/Relation/04-multiarch.t
index 6f94f15..b700a88 100644
--- a/t/scripts/Lintian/Relation/04-multiarch.t
+++ b/t/scripts/Lintian/Relation/04-multiarch.t
@@ -17,7 +17,7 @@ ok(! $relation->implies ('pkgC'),     'archless implies [pkgC]');
 ok($relation->implies ('pkgC:i386'),  'identity implies [pkgC]');
 
 TODO: {
-    local $TODO = ":X => :Y cases are not implemented";
+    local $TODO = ':X => :Y cases are not implemented';
 
     ok($relation->implies ('pkgA'),       'archless implies [pkgA]');
 
@@ -38,7 +38,7 @@ is_deeply(\@dups3, [],                                    'pkgD:i386 and pkgD ar
 is_deeply(\@dups4, [['pkgD:i386', 'pkgD:i386 (>= 1.0)']], 'Can detect pkgD:i386 dups');
 
 TODO: {
-    local $TODO = ":X => :Y cases are not implemented";
+    local $TODO = ':X => :Y cases are not implemented';
 
     is_deeply(\@dups1, [['pkgD', 'pkgD:any']],                'pkgD and pkgD:any are dups');
     is_deeply(\@dups2, [['pkgD:i386', 'pkgD:any']],           'pkgD:i386 and pkgD:any are dups');
diff --git a/t/scripts/ancient-sv-date.t b/t/scripts/ancient-sv-date.t
index 0091406..0800744 100755
--- a/t/scripts/ancient-sv-date.t
+++ b/t/scripts/ancient-sv-date.t
@@ -41,8 +41,8 @@ while ( my $line = <$fd> ) {
         my $and = str2time($date) or die "Cannot parse date ($date, line $.): $!";
         my $time = time - ANCIENT_AGE;
         $found = 1;
-        cmp_ok($time, '<', $and + ERROR_MARGIN, "ANCIENT_DATE is up to date");
-        cmp_ok($time, '>', $and - ERROR_MARGIN, "ANCIENT_DATE is not too far ahead");
+        cmp_ok($time, '<', $and + ERROR_MARGIN, 'ANCIENT_DATE is up to date');
+        cmp_ok($time, '>', $and - ERROR_MARGIN, 'ANCIENT_DATE is not too far ahead');
         last;
     }
 }
diff --git a/t/scripts/changelog-format.t b/t/scripts/changelog-format.t
index ab18a80..18b288c 100755
--- a/t/scripts/changelog-format.t
+++ b/t/scripts/changelog-format.t
@@ -101,8 +101,10 @@ foreach (split /\n/,$changes) {
 	    or diag("line: $line");
     }
 
-    $prev_head = $1
-	if (m/^([*+-])/);
+    if (m/^([*+-])/) {
+        $prev_head = $1;
+    }
+
 }
 
 done_testing();
diff --git a/t/scripts/critic.t b/t/scripts/critic.t
index 405143f..eee65d7 100755
--- a/t/scripts/critic.t
+++ b/t/scripts/critic.t
@@ -1,6 +1,8 @@
 #!/usr/bin/perl
 
 use strict;
+use warnings;
+
 use Test::More;
 
 sub should_skip();
@@ -14,7 +16,7 @@ plan skip_all => 'Only UNRELEASED versions are criticised'
 
 
 eval 'use Test::Perl::Critic 1.00';
-plan skip_all => "Test::Perl::Critic 1.00 required to run this test" if $@;
+plan skip_all => 'Test::Perl::Critic 1.00 required to run this test' if $@;
 
 eval 'use PPIx::Regexp';
 diag('libppix-regexp-perl is needed to enable some checks') if $@;
@@ -24,14 +26,16 @@ Test::Perl::Critic->import( -profile => '.perlcriticrc' );
 
 
 our @CHECKS = glob ('checks/*[!.]*[!c]');
-plan tests => scalar(@CHECKS)+1;
+plan tests => scalar(@CHECKS)+2;
 
 for my $check (@CHECKS) {
     critic_ok($check);
 }
 
+critic_ok('t/runtests');
+
 subtest 'All scripts with correct shebang or extension' => sub {
-    all_critic_ok(qw(collection frontend lib private));
+    all_critic_ok(qw(collection frontend lib private t/scripts t/helper));
 };
 
 sub should_skip() {
@@ -42,7 +46,7 @@ sub should_skip() {
 
     die("failed to execute dpkg-parsechangelog: $!")
 	unless defined ($pid);
-    
+
     while (<DPKG>) {
 	$skip = 0 if m/^Distribution: UNRELEASED$/;
     }
diff --git a/t/scripts/implemented-tags.t b/t/scripts/implemented-tags.t
index 704fc52..1003c81 100755
--- a/t/scripts/implemented-tags.t
+++ b/t/scripts/implemented-tags.t
@@ -17,6 +17,7 @@
 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 
 use Test::More;
 use Test::Lintian;
diff --git a/t/scripts/needs-info-exists.t b/t/scripts/needs-info-exists.t
index 6b6ac6b..ff38521 100755
--- a/t/scripts/needs-info-exists.t
+++ b/t/scripts/needs-info-exists.t
@@ -17,6 +17,7 @@
 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 
 use Test::More;
 use Lintian::CollScript;
@@ -25,7 +26,7 @@ use Lintian::Util qw(read_dpkg_control);
 # Find all of the desc files in collection.  We'll do one check per
 # description.  We don't check checks/*.desc because check-desc.t
 # handles that.
-our @DESCS = (<$ENV{LINTIAN_ROOT}/collection/*.desc>);
+our @DESCS = (glob("$ENV{LINTIAN_ROOT}/collection/*.desc"));
 plan tests => scalar(@DESCS);
 
 # For each desc file, load the first stanza of the file and check that all of
diff --git a/t/scripts/needs-info-missing.t b/t/scripts/needs-info-missing.t
index 535cfed..4811620 100755
--- a/t/scripts/needs-info-missing.t
+++ b/t/scripts/needs-info-missing.t
@@ -17,15 +17,16 @@
 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 
 use Test::More;
 use Lintian::Util qw(read_dpkg_control slurp_entire_file);
 
 # Find all of the desc files in checks.  We'll do one check per description.
-our @DESCS = (<$ENV{LINTIAN_ROOT}/checks/*.desc>,
-              <$ENV{LINTIAN_ROOT}/collection/*.desc>);
-our @MODULES = (<$ENV{LINTIAN_ROOT}/lib/Lintian/Collect.pm>,
-		<$ENV{LINTIAN_ROOT}/lib/Lintian/Collect/*.pm>);
+our @DESCS = (glob("$ENV{LINTIAN_ROOT}/checks/*.desc"),
+              glob("$ENV{LINTIAN_ROOT}/collection/*.desc"));
+our @MODULES = (glob("$ENV{LINTIAN_ROOT}/lib/Lintian/Collect.pm"),
+		glob("$ENV{LINTIAN_ROOT}/lib/Lintian/Collect/*.pm"));
 
 plan tests => scalar(@DESCS)+scalar(@MODULES);
 
@@ -109,8 +110,8 @@ for my $module (@MODULES) {
 
     is(scalar(keys(%seen_subs)) + scalar(keys(%seen_needsinfo)), 0,
 	"$pretty_module has per-method needs-info") or
-	diag("Subs missing info: ", join(', ', keys(%seen_subs)), "\n",
-	     "Info for unknown subs: ", join(', ', keys(%seen_needsinfo)),"\n");
+	diag('Subs missing info: ', join(', ', keys(%seen_subs)), "\n",
+	     'Info for unknown subs: ', join(', ', keys(%seen_needsinfo)),"\n");
 
     diag("\n", @warnings) if @warnings;
 }
@@ -120,7 +121,7 @@ for my $desc (@DESCS) {
     my %needs = map { $_ => 1 } split(/\s*,\s*/, $header->{'needs-info'} || '');
 
     if ($desc =~ m/lintian\.desc$/) {
-	pass("lintian.desc has all required needs-info for Lintian::Collect");
+	pass('lintian.desc has all required needs-info for Lintian::Collect');
 	next;
     }
 
diff --git a/t/scripts/pod-synopsis.t b/t/scripts/pod-synopsis.t
index c9b7e68..0d7b8b1 100755
--- a/t/scripts/pod-synopsis.t
+++ b/t/scripts/pod-synopsis.t
@@ -5,8 +5,8 @@ use warnings;
 
 use Test::More;
 use Test::Pod;
-eval "use Test::Synopsis";
-plan skip_all => "Test::Synopsis required for testing" if $@;
+eval 'use Test::Synopsis';
+plan skip_all => 'Test::Synopsis required for testing' if $@;
 
 my @pod_files = all_pod_files("$ENV{'LINTIAN_ROOT'}/lib");
 plan tests => scalar(@pod_files);
diff --git a/t/scripts/pod.t b/t/scripts/pod.t
index bcce14f..a5fb55b 100755
--- a/t/scripts/pod.t
+++ b/t/scripts/pod.t
@@ -4,7 +4,8 @@
 # Test::Pod documentation.
 
 use strict;
+use warnings;
 use Test::More;
 eval 'use Test::Pod 1.00';
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@;
 all_pod_files_ok(all_pod_files("$ENV{LINTIAN_ROOT}/lib"));
diff --git a/t/scripts/profiles-coverage.t b/t/scripts/profiles-coverage.t
index 9349bf3..b8fbdd5 100755
--- a/t/scripts/profiles-coverage.t
+++ b/t/scripts/profiles-coverage.t
@@ -13,7 +13,6 @@ use File::Find;
 use Lintian::Util qw(read_dpkg_control); # Test::More (also) exports fail
 
 my $root = $ENV{'LINTIAN_ROOT'};
-my @profiles;
 my %CHECKS;
 my %TAGS;
 
diff --git a/t/scripts/static-lab.t b/t/scripts/static-lab.t
index 190cc2f..c3229c3 100755
--- a/t/scripts/static-lab.t
+++ b/t/scripts/static-lab.t
@@ -8,7 +8,7 @@ use Test::Simple tests => 4;
 my $lintian_path = "$ENV{LINTIAN_ROOT}/frontend/lintian";
 my $labdir = tempdir(CLEANUP => 1);
 
-ok(system("$lintian_path --allow-root --lab $labdir --setup-lab") == 0, "Create");
-ok(system("$lintian_path --allow-root --lab $labdir --setup-lab") == 0, "Renew");
-ok(system("$lintian_path --allow-root --lab $labdir --remove-lab") == 0, "Remove");
-ok(system("rmdir $labdir") == 0, "Rmdir");
+ok(system("$lintian_path --allow-root --lab $labdir --setup-lab") == 0, 'Create');
+ok(system("$lintian_path --allow-root --lab $labdir --setup-lab") == 0, 'Renew');
+ok(system("$lintian_path --allow-root --lab $labdir --remove-lab") == 0, 'Remove');
+ok(system("rmdir $labdir") == 0, 'Rmdir');
diff --git a/t/scripts/strict.t b/t/scripts/strict.t
index 041b1d1..85e85cb 100755
--- a/t/scripts/strict.t
+++ b/t/scripts/strict.t
@@ -5,7 +5,7 @@ use warnings;
 
 use Test::More;
 eval 'use Test::Strict';
-plan skip_all => "Test::Strict required to run this test" if $@;
+plan skip_all => 'Test::Strict required to run this test' if $@;
 
 my @DIRS = map { "$ENV{'LINTIAN_ROOT'}/$_" } qw(lib private frontend);
 all_perl_files_ok(@DIRS);
diff --git a/t/scripts/unpack-level.t b/t/scripts/unpack-level.t
index 63e47fa..8adc0af 100755
--- a/t/scripts/unpack-level.t
+++ b/t/scripts/unpack-level.t
@@ -17,6 +17,7 @@
 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 
 use Test::More;
 use Lintian::CollScript;
@@ -24,8 +25,8 @@ use Lintian::Util qw(read_dpkg_control slurp_entire_file);
 
 # Find all of the desc files in either collection or checks.  We'll do one
 # check per description.
-our @DESCS = (<$ENV{LINTIAN_ROOT}/collection/*.desc>,
-              <$ENV{LINTIAN_ROOT}/checks/*.desc>);
+our @DESCS = (glob("$ENV{LINTIAN_ROOT}/collection/*.desc>"),
+              glob("$ENV{LINTIAN_ROOT}/checks/*.desc"));
 plan tests => scalar(@DESCS);
 
 my @l2refs = (
@@ -49,7 +50,7 @@ for my $desc (@DESCS) {
     }
 
     if ($desc =~ m/lintian\.desc$/) {
-	ok(1, "lintian.desc has valid needs-info for unpack level");
+	ok(1, 'lintian.desc has valid needs-info for unpack level');
 	next;
     }
 

-- 
Debian package checker


Reply to: