4 BEGIN { plan skip_all => "Install Capture::Tiny to test installation"
5 unless eval { require Capture::Tiny; 1 } }
6 use Capture::Tiny qw(capture);
7 use File::Temp qw(tempdir);
14 my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1);
17 local::lib->import($dir);
20 SKIP: for my $dist_type (qw(EUMM MB)) {
21 chdir File::Spec->catdir($orig_dir, qw(t dist), $dist_type);
22 if ($dist_type eq 'EUMM') {
23 my ($stdout, $stderr) = capture { eval {
24 system($^X, 'Makefile.PL') && die "Makefile.PL failed";
25 system($Config{make}, 'install') && die "$Config{make} install failed";
27 diag $stdout, $stderr if $@;
29 my ($stdout, $stderr) = capture { eval {
30 system($^X, 'Build.PL') && die "Build.PL failed";
31 system($^X, 'Build', 'install') && die "Build install failed";
33 diag $stdout, $stderr if $@;
36 -e File::Spec->catfile(
37 $dir, qw(lib perl5), "$dist_type.pm",
39 "$dist_type.pm installed into the correct location",