4 BEGIN { plan skip_all => "Install Capture::Tiny to test installation"
5 unless eval { require Capture::Tiny; 1 } }
6 use Capture::Tiny qw(capture);
11 use lib 't/lib'; use TempDir;
15 my $dir = mk_temp_dir('test_local_lib-XXXXX');
18 local::lib->import($dir);
21 SKIP: for my $dist_type (qw(MB EUMM)) {
22 chdir File::Spec->catdir($orig_dir, qw(t dist), $dist_type);
23 if ($dist_type eq 'EUMM') {
24 my ($stdout, $stderr) = capture { eval {
25 system($^X, 'Makefile.PL') && die "Makefile.PL failed";
26 system($Config{make}, 'install') && die "$Config{make} install failed";
28 diag $stdout, $stderr if $@;
30 my ($stdout, $stderr) = capture { eval {
31 system($^X, 'Build.PL') && die "Build.PL failed";
32 system($^X, 'Build', 'install') && die "Build install failed";
34 diag $stdout, $stderr if $@;
36 my $file = File::Spec->catfile($dir, qw(lib perl5), "$dist_type.pm");
39 "$dist_type - $dist_type.pm installed as $file",
42 my $dest_dir = File::Spec->catdir($dir, qw(lib perl5));
43 diag 'Files in ' . $dest_dir . ":\n", join("\n", glob(File::Spec->catfile($dest_dir, '*')));