use Capture::Tiny qw(capture);
use File::Next qw();
use File::Which qw(which);
+use Module::Build qw();
use Test::More;
# Skip means sweep bugs under the rug.
BAIL_OUT 'xmllint (part of the libxml2 package) not installed.'
unless which 'xmllint';
-my $destdir;
-{
- my $runtime_params_file = '_build/runtime_params';
- my $runtime_params = do $runtime_params_file;
- die "Could not load $runtime_params_file. Run Build.PL first.\n"
- unless $runtime_params;
- $destdir = $runtime_params->{destdir};
-}
+my $build;
+eval { $build = Module::Build->current; 1; }
+ or BAIL_OUT 'We are not in a Module::Build session. Run Build.PL first.';
my $iter = File::Next::files({
file_filter => sub {/\.html \z/msx},
sort_files => 1,
},
- $destdir
+ $build->destdir
);
my $file_counter;