use normalized path on win32 in this test too
[p5sagit/local-lib.git] / t / install.t
CommitLineData
be160790 1use strict;
2use warnings;
3use Test::More;
4BEGIN { plan skip_all => "Install Capture::Tiny to test installation"
5 unless eval { require Capture::Tiny; 1 } }
6use Capture::Tiny qw(capture);
be160790 7use File::Spec;
8use Cwd;
9use Config;
10
4f7dfe32 11use lib 't/lib'; use TempDir;
12
be160790 13plan tests => 2;
14
4f7dfe32 15my $dir = mk_temp_dir('test_local_lib-XXXXX');
be160790 16
17use local::lib ();
18local::lib->import($dir);
19
20my $orig_dir = cwd;
21SKIP: for my $dist_type (qw(EUMM MB)) {
22 chdir File::Spec->catdir($orig_dir, qw(t dist), $dist_type);
23 if ($dist_type eq 'EUMM') {
8522f4d5 24 my ($stdout, $stderr) = capture { eval {
be160790 25 system($^X, 'Makefile.PL') && die "Makefile.PL failed";
26 system($Config{make}, 'install') && die "$Config{make} install failed";
27 } };
28 diag $stdout, $stderr if $@;
29 } else {
30 my ($stdout, $stderr) = capture { eval {
31 system($^X, 'Build.PL') && die "Build.PL failed";
32 system($^X, 'Build', 'install') && die "Build install failed";
33 } };
34 diag $stdout, $stderr if $@;
35 }
5da9706a 36 my $file = File::Spec->catfile($dir, qw(lib perl5), "$dist_type.pm");
be160790 37 ok(
5da9706a 38 -e $file,
4f7dfe32 39 "$dist_type - $dist_type.pm installed as $file",
be160790 40 );
41}