summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRuss Allbery <rra@cpan.org>2019-07-14 16:39:44 -0700
committerRuss Allbery <rra@cpan.org>2019-07-14 16:40:43 -0700
commit69c77df2a4f29fa15d3ed2fba78f5e3438c34169 (patch)
treec4f9d363424254166ef3ee4d2ceae83d1baf948b /t
parent65f6bda9a030cdb85549cd1a16e81ff215ac9ca4 (diff)
Allow the path to Perl to be configured for dist
Allow the path to Perl to be configured in App::DocKnot::Dist. This is used primarily for testing so that we can try building a distribution using Module::Build with the same Perl used to run the test suite. This is exposed by the module API but (intentially) not exposed on the docknot command line. Thanks, Slaven Rezic. (#129958)
Diffstat (limited to 't')
-rwxr-xr-xt/dist/basic.t2
-rwxr-xr-xt/dist/commands.t14
2 files changed, 14 insertions, 2 deletions
diff --git a/t/dist/basic.t b/t/dist/basic.t
index 2c25da2..fb3a943 100755
--- a/t/dist/basic.t
+++ b/t/dist/basic.t
@@ -72,7 +72,7 @@ require_ok('App::DocKnot::Dist');
mkdir($distdir);
chdir($sourcedir);
eval {
- my $dist = App::DocKnot::Dist->new({ distdir => $distdir });
+ my $dist = App::DocKnot::Dist->new({ distdir => $distdir, perl => $^X });
capture_stdout { $dist->make_distribution() };
};
ok(-f File::Spec->catfile($distdir, 'Empty-1.00.tar.gz'), 'dist exists');
diff --git a/t/dist/commands.t b/t/dist/commands.t
index f3d1f76..9c57189 100755
--- a/t/dist/commands.t
+++ b/t/dist/commands.t
@@ -12,7 +12,7 @@ use warnings;
use File::Spec;
-use Test::More tests => 6;
+use Test::More tests => 7;
# Load the module.
BEGIN { use_ok('App::DocKnot::Dist') }
@@ -33,6 +33,18 @@ my @expected = (
my @seen = $docknot->commands();
is_deeply(\@seen, \@expected, 'Module::Build');
+# Test configuring an alternate path to Perl.
+$docknot = App::DocKnot::Dist->new({ distdir => q{.}, perl => '/a/perl' });
+#<<<
+@expected = (
+ ['/a/perl', 'Build.PL'],
+ ['./Build', 'disttest'],
+ ['./Build', 'dist'],
+);
+#>>>
+@seen = $docknot->commands();
+is_deeply(\@seen, \@expected, 'Module::Build');
+
# ExtUtils::MakeMaker distribution.
my $metadata_path = File::Spec->catfile($dataroot, 'ansicolor', 'metadata');
$docknot