use Carp;
use lib;
use FindBin;
+use File::Spec ();
-my $basedir;
-if (-r "$FindBin::Bin/Makefile.PL") {
- $basedir = $FindBin::Bin;
-}
-elsif (-r "$FindBin::Bin/../Makefile.PL") {
- $basedir = "$FindBin::Bin/..";
-}
+# Look up to see find Makefile.PL aka the base of the local::lib install.
+my $lookup; $lookup = sub {
+ my $dir = $_[0] || '.';
+
+ my(undef, $dirbit) = File::Spec->splitpath($FindBin::Bin);
+ my $trydir = File::Spec->catdir($dirbit, $dir);
+
+ return '' unless -d $trydir;
+
+ my $tryfile = File::Spec->catfile($trydir, "Makefile.PL");
+
+ return $trydir if -r $tryfile;
+
+ return $lookup->( File::Spec->catdir($dir, File::Spec->updir) );
+};
+
+my $basedir = $lookup->();
$basedir ||= '';
my $target = "$basedir/local-lib5";
-#!/usr/bin/env perl
+use FindBin qw/$Bin/;
+BEGIN {
+ my $env = "$FindBin::Bin/../../script/env";
+ if (-r $env) {
+ do $env or die $@;
+ }
+}
+
use strict;
use warnings;
use Test::More;
use Test::Pod::Coverage 1.04;
-all_pod_coverage_ok({
+pod_coverage_ok($_, {
also_private => [qw/
BUILD
BUILDARGS
build_per_context_instance
/],
-});
+}) for all_modules('lib');