diff options
author | gregor herrmann <gregoa@debian.org> | 2024-01-27 03:00:56 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2024-01-27 03:00:56 +0100 |
commit | 72ca4f247971b793a6f3a75217f995342e4c917e (patch) | |
tree | 1977705a6ed41561b4d2336b61ba2eb13afba59a | |
parent | 5aea1354c5a01d0aca775ff8ac6b2aa2d5967ce4 (diff) |
Adjust tests to autopkgtest
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.t | 4 | ||||
-rw-r--r-- | t/80_version_overload.t | 4 | ||||
-rw-r--r-- | t/81_version_overload_with_explicit_vpp.t | 4 |
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"; |