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

[SCM] Debian package checker branch, master, updated. 2.5.12-66-g52efdde



The following commit has been merged in the master branch:
commit 52efddec0c1fcdd3bdd7bbeada94846111654e91
Author: Niels Thykier <niels@thykier.net>
Date:   Sat May 4 22:00:15 2013 +0200

    t/scripts/*: Set $ENV{LINTIAN_ROOT} if needed
    
    Have the tests set $ENV{LINTIAN_ROOT} if they need it, so they work
    under "prove -lr t".
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/scripts/ancient-sv-date.t b/t/scripts/ancient-sv-date.t
index 6fc20e5..0b43ca2 100755
--- a/t/scripts/ancient-sv-date.t
+++ b/t/scripts/ancient-sv-date.t
@@ -29,6 +29,8 @@ plan skip_all => 'Only checked for UNRELEASED versions'
 
 plan tests => 2;
 
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 my $check = "$ENV{'LINTIAN_ROOT'}/checks/standards-version";
 my $found = 0;
 open(my $fd, '<', $check);
diff --git a/t/scripts/check-descs.t b/t/scripts/check-descs.t
index 6e9ac0f..49bcc8c 100755
--- a/t/scripts/check-descs.t
+++ b/t/scripts/check-descs.t
@@ -22,6 +22,13 @@ use strict;
 use warnings;
 
 use Test::More import => ['done_testing'];
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Test::Lintian;
 
 load_profile_for_test ('debian/main', $ENV{'LINTIAN_ROOT'});
diff --git a/t/scripts/check-load.t b/t/scripts/check-load.t
index 839f36d..554d6e1 100755
--- a/t/scripts/check-load.t
+++ b/t/scripts/check-load.t
@@ -22,6 +22,13 @@ use strict;
 use warnings;
 
 use Test::More import => ['done_testing'];
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Test::Lintian;
 
 # Test that all checks can be loaded (except lintian.desc, which is
diff --git a/t/scripts/critic.t b/t/scripts/critic.t
index 8b23fe6..7fe8009 100755
--- a/t/scripts/critic.t
+++ b/t/scripts/critic.t
@@ -6,6 +6,7 @@ use autodie;
 
 use Test::More;
 
+$ENV{'LINTIAN_ROOT'} //= '.';
 
 chdir($ENV{'LINTIAN_ROOT'});
 
diff --git a/t/scripts/implemented-tags.t b/t/scripts/implemented-tags.t
index 1003c81..a94b1aa 100755
--- a/t/scripts/implemented-tags.t
+++ b/t/scripts/implemented-tags.t
@@ -20,6 +20,13 @@ use strict;
 use warnings;
 
 use Test::More;
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Test::Lintian;
 
 # Exclude the following tags, which are handled specially and can't be
diff --git a/t/scripts/minimum-version.t b/t/scripts/minimum-version.t
index 92682c6..6cd1ebc 100755
--- a/t/scripts/minimum-version.t
+++ b/t/scripts/minimum-version.t
@@ -16,6 +16,8 @@ our $REQUIRED = 'v5.10.0';
 
 our @PATHS = qw(checks collection frontend lib reporting private);
 
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 # It creates as many threads as elements in @PATHS
 for my $path (@PATHS) {
     threads->create(sub {
diff --git a/t/scripts/needs-info-exists.t b/t/scripts/needs-info-exists.t
index ff38521..719bd0f 100755
--- a/t/scripts/needs-info-exists.t
+++ b/t/scripts/needs-info-exists.t
@@ -20,6 +20,13 @@ use strict;
 use warnings;
 
 use Test::More;
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Lintian::CollScript;
 use Lintian::Util qw(read_dpkg_control);
 
diff --git a/t/scripts/needs-info-missing.t b/t/scripts/needs-info-missing.t
index dc954f7..fb4030d 100755
--- a/t/scripts/needs-info-missing.t
+++ b/t/scripts/needs-info-missing.t
@@ -22,6 +22,12 @@ use autodie;
 
 use Test::More;
 
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 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.
diff --git a/t/scripts/pod-synopsis.t b/t/scripts/pod-synopsis.t
index 0d7b8b1..3e99e89 100755
--- a/t/scripts/pod-synopsis.t
+++ b/t/scripts/pod-synopsis.t
@@ -8,6 +8,8 @@ use Test::Pod;
 eval 'use Test::Synopsis';
 plan skip_all => 'Test::Synopsis required for testing' if $@;
 
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 my @pod_files = all_pod_files("$ENV{'LINTIAN_ROOT'}/lib");
 plan tests => scalar(@pod_files);
 synopsis_ok(@pod_files);
diff --git a/t/scripts/pod.t b/t/scripts/pod.t
index fc0b26d..7db750d 100755
--- a/t/scripts/pod.t
+++ b/t/scripts/pod.t
@@ -8,6 +8,9 @@ use warnings;
 use Test::More;
 eval 'use Test::Pod 1.00';
 plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@;
+
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 all_pod_files_ok(all_pod_files("$ENV{LINTIAN_ROOT}/lib",
                                "$ENV{'LINTIAN_ROOT'}/doc/tutorial"));
 
diff --git a/t/scripts/profile-load.t b/t/scripts/profile-load.t
index aabc44a..db8be46 100755
--- a/t/scripts/profile-load.t
+++ b/t/scripts/profile-load.t
@@ -5,9 +5,16 @@
 use strict;
 use warnings;
 
-use Test::Lintian;
 use Test::More;
 
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
+use Test::Lintian;
+
 # We could use a plan, but then we had to update every time we added
 # or removed a profile...
 test_load_profiles ($ENV{'LINTIAN_ROOT'}, $ENV{'LINTIAN_ROOT'});
diff --git a/t/scripts/profiles-coverage.t b/t/scripts/profiles-coverage.t
index b8fbdd5..81fc9cf 100755
--- a/t/scripts/profiles-coverage.t
+++ b/t/scripts/profiles-coverage.t
@@ -7,9 +7,15 @@
 use strict;
 use warnings;
 
+use File::Find;
 use Test::More;
 
-use File::Find;
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Lintian::Util qw(read_dpkg_control); # Test::More (also) exports fail
 
 my $root = $ENV{'LINTIAN_ROOT'};
diff --git a/t/scripts/static-lab.t b/t/scripts/static-lab.t
index c3229c3..f3280f5 100755
--- a/t/scripts/static-lab.t
+++ b/t/scripts/static-lab.t
@@ -5,9 +5,13 @@ use warnings;
 use File::Temp qw(tempdir);
 use Test::Simple tests => 4;
 
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 my $lintian_path = "$ENV{LINTIAN_ROOT}/frontend/lintian";
 my $labdir = tempdir(CLEANUP => 1);
 
+$lintian_path = $ENV{'LINTIAN_FRONTEND'} if exists($ENV{'LINTIAN_FRONTEND'});
+
 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');
diff --git a/t/scripts/strict.t b/t/scripts/strict.t
index dd84287..71397a1 100755
--- a/t/scripts/strict.t
+++ b/t/scripts/strict.t
@@ -8,6 +8,8 @@ use Test::More;
 eval 'use Test::Strict';
 plan skip_all => 'Test::Strict required to run this test' if $@;
 
+$ENV{'LINTIAN_ROOT'} //= '.';
+
 my @DIRS = map { "$ENV{'LINTIAN_ROOT'}/$_" } qw(lib private frontend collection);
 all_perl_files_ok(@DIRS);
 
diff --git a/t/scripts/unpack-level.t b/t/scripts/unpack-level.t
index 8adc0af..439a4ea 100755
--- a/t/scripts/unpack-level.t
+++ b/t/scripts/unpack-level.t
@@ -20,6 +20,13 @@ use strict;
 use warnings;
 
 use Test::More;
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} //= '.';
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+
 use Lintian::CollScript;
 use Lintian::Util qw(read_dpkg_control slurp_entire_file);
 

-- 
Debian package checker


Reply to: