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

[SCM] Debian package checker branch, master, updated. 2.4.3-190-gccd5298



The following commit has been merged in the master branch:
commit ccd529880ec51ed6127b2c7fa1fd8efc1e55d389
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Thu Jan 27 12:27:16 2011 -0600

    Chdir to LINTIAN_ROOT in t/scripts/critic.t to simplify it
    
    As a side effect, the output is less noisy.

diff --git a/t/scripts/critic.t b/t/scripts/critic.t
index be2243d..c4dfbe5 100755
--- a/t/scripts/critic.t
+++ b/t/scripts/critic.t
@@ -3,10 +3,15 @@
 use strict;
 use Test::More;
 
-sub should_skip($);
+sub should_skip();
+
+
+chdir ($ENV{'LINTIAN_ROOT'})
+    or die ("fatal error: could not chdir to $ENV{LINTIAN_ROOT}: $!");
 
 plan skip_all => 'Only UNRELEASED versions are criticised'
-    if should_skip($ENV{'LINTIAN_ROOT'});
+    if should_skip();
+
 
 eval 'use Test::Perl::Critic 1.00';
 plan skip_all => "Test::Perl::Critic 1.00 required to run this test" if $@;
@@ -14,10 +19,11 @@ 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 $@;
 
-Test::Perl::Critic->import( -profile => "$ENV{LINTIAN_ROOT}/.perlcriticrc" );
 
-our @CHECKS = glob ("$ENV{LINTIAN_ROOT}/checks/*[!.]*[!c]");
+Test::Perl::Critic->import( -profile => '.perlcriticrc' );
+
 
+our @CHECKS = glob ('checks/*[!.]*[!c]');
 plan tests => scalar(@CHECKS)+1;
 
 for my $check (@CHECKS) {
@@ -25,19 +31,14 @@ for my $check (@CHECKS) {
 }
 
 subtest 'All scripts with correct shebang or extension' => sub {
-    all_critic_ok("$ENV{LINTIAN_ROOT}/collection",
-		  "$ENV{LINTIAN_ROOT}/frontend",
-		  "$ENV{LINTIAN_ROOT}/lib",
-		  "$ENV{LINTIAN_ROOT}/unpack");
+    all_critic_ok(qw(collection frontend lib unpack));
 };
 
-sub should_skip($) {
-    my $path = shift;
+sub should_skip() {
     my $skip = 1;
     my $pid;
 
-    $pid = open (DPKG, '-|', 'dpkg-parsechangelog', '-c0',
-	    "-l$path/debian/changelog");
+    $pid = open (DPKG, '-|', 'dpkg-parsechangelog', '-c0');
 
     die("failed to execute dpkg-parsechangelog: $!")
 	unless defined ($pid);

-- 
Debian package checker


Reply to: