diff options
Diffstat (limited to 't')
-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"; |