summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2020-12-13 02:36:27 +0100
committergregor herrmann <gregoa@debian.org>2020-12-13 02:36:27 +0100
commit3bf17e4d4f4a6ec69de93df64f0902dee2bfb191 (patch)
tree1fa21d2b0ebd096f79506e45a018f7013c195e6e
parent13916479f8d039759fe961a0758d14706610a618 (diff)
Adjust tests to autopkgtestarchive/debian/0.43-1
Origin: vendor Forwarded: not-needed Last-Update: 2015-05-11 During autopkgtest, look for the installed modules and not the one in the build tree. Decide by looking for $ENV{AUTOPKGTEST_TMP}. Gbp-Pq: Name autopkgtest.patch
-rw-r--r--t/10_self_check.t4
-rw-r--r--t/80_version_overload.t4
-rw-r--r--t/81_version_overload_with_explicit_vpp.t4
3 files changed, 9 insertions, 3 deletions
diff --git a/t/10_self_check.t b/t/10_self_check.t
index 5e184f5..a4705ca 100644
--- a/t/10_self_check.t
+++ b/t/10_self_check.t
@@ -3,12 +3,14 @@ use warnings;
use Test::More tests => 2;
use FindBin;
use Parse::PMFile;
+use Config;
for (0..1) {
no warnings 'once';
local $Parse::PMFile::FORK = $_;
my $p = Parse::PMFile->new;
- my $pkg = $p->parse("$FindBin::Bin/../lib/Parse/PMFile.pm");
+ my $dir = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : "$FindBin::Bin/../lib";
+ my $pkg = $p->parse("$dir/Parse/PMFile.pm");
is $pkg->{'Parse::PMFile'}{version} => $Parse::PMFile::VERSION, "version of Parse::PMFile matches \$Parse::PMFile::VERSION";
}
diff --git a/t/80_version_overload.t b/t/80_version_overload.t
index fc60a3d..4acf0a8 100644
--- a/t/80_version_overload.t
+++ b/t/80_version_overload.t
@@ -3,6 +3,7 @@ use warnings;
use Test::More;
use FindBin;
use Parse::PMFile;
+use Config;
for my $fork (0..1) {
test_version($fork);
@@ -10,7 +11,8 @@ for my $fork (0..1) {
no warnings 'once';
local $Parse::PMFile::FORK = $_;
my $p = Parse::PMFile->new;
- my $pkg = $p->parse("$FindBin::Bin/../lib/Parse/PMFile.pm");
+ my $dir = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : "$FindBin::Bin/../lib";
+ my $pkg = $p->parse("$dir/Parse/PMFile.pm");
is $pkg->{'Parse::PMFile'}{version} => $Parse::PMFile::VERSION, "version of Parse::PMFile matches \$Parse::PMFile::VERSION";
diff --git a/t/81_version_overload_with_explicit_vpp.t b/t/81_version_overload_with_explicit_vpp.t
index 7f229b1..a656fcb 100644
--- a/t/81_version_overload_with_explicit_vpp.t
+++ b/t/81_version_overload_with_explicit_vpp.t
@@ -3,6 +3,7 @@ use warnings;
use Test::More;
use FindBin;
use Parse::PMFile;
+use Config;
eval "use version::vpp; 1" or plan skip_all => "requires version::vpp";
@@ -12,7 +13,8 @@ for my $fork (0..1) {
no warnings 'once';
local $Parse::PMFile::FORK = $_;
my $p = Parse::PMFile->new;
- my $pkg = $p->parse("$FindBin::Bin/../lib/Parse/PMFile.pm");
+ my $dir = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : "$FindBin::Bin/../lib";
+ my $pkg = $p->parse("$dir/Parse/PMFile.pm");
is $pkg->{'Parse::PMFile'}{version} => $Parse::PMFile::VERSION, "version of Parse::PMFile matches \$Parse::PMFile::VERSION";