This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update ExtUtils-Install to CPAN version 2.14
[perl5.git] / cpan / ExtUtils-Install / t / InstallWithMM.t
CommitLineData
16f0d0fc
YO
1#!/usr/bin/perl -w
2
3# Make sure EUI works with MakeMaker
4
5BEGIN {
fb78ba4b 6 unshift @INC, 't/lib';
16f0d0fc
YO
7}
8
9use strict;
10use Config;
11use ExtUtils::MakeMaker;
12
20c2f11b 13use Test::More;
16f0d0fc 14use MakeMaker::Test::Utils;
20c2f11b
BF
15
16my $make;
17BEGIN {
18 $make = make_run();
19 if (!$make) {
20 plan skip_all => "make isn't available";
21 }
22 else {
23 plan tests => 15;
24 }
25}
26
16f0d0fc
YO
27use MakeMaker::Test::Setup::BFD;
28use File::Find;
29use File::Spec;
30use File::Path;
80af860f 31use File::Temp qw[tempdir];
16f0d0fc 32
16f0d0fc
YO
33# Environment variables which interfere with our testing.
34delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
35
36# Run Makefile.PL
37{
38 my $perl = which_perl();
39 my $Is_VMS = $^O eq 'VMS';
40
16f0d0fc
YO
41 perl_lib;
42
80af860f
CBW
43 my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 );
44 chdir $tmpdir;
e2ed8602 45
16f0d0fc
YO
46 my $Touch_Time = calibrate_mtime();
47
48 $| = 1;
49
50 ok( setup_recurs(), 'setup' );
51 END {
52 ok( chdir File::Spec->updir );
53 ok( teardown_recurs(), 'teardown' );
54 }
55
56 ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
57 diag("chdir failed: $!");
58
9de35bb2 59 my @mpl_out = run(qq{"$perl" Makefile.PL "PREFIX=../dummy-install"});
16f0d0fc
YO
60 END { rmtree '../dummy-install'; }
61
62 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
63 diag(@mpl_out);
64
65 END { unlink makefile_name(), makefile_backup() }
66}
67
68
69# make
70{
71 my $make_out = run($make);
72 is( $?, 0, 'make ran ok' ) ||
73 diag($make_out);
74}
75
76
77# Test 'make install VERBINST=1'
78{
79 my $make_install_verbinst = make_macro($make, 'install', VERBINST => 1);
80 my $install_out = run($make_install_verbinst);
81 is( $?, 0, 'install' ) || diag $install_out;
82 like( $install_out, qr/^Installing /m );
83 like( $install_out, qr/^Writing /m );
84
85 ok( -r '../dummy-install', ' install dir created' );
86 my %files = ();
87 find( sub {
88 # do it case-insensitive for non-case preserving OSs
89 my $file = lc $_;
90
91 # VMS likes to put dots on the end of things that don't have them.
92 $file =~ s/\.$// if $Is_VMS;
93
94 $files{$file} = $File::Find::name;
95 }, '../dummy-install' );
96 ok( $files{'dummy.pm'}, ' Dummy.pm installed' );
97 ok( $files{'liar.pm'}, ' Liar.pm installed' );
98 ok( $files{'program'}, ' program installed' );
99 ok( $files{'.packlist'}, ' packlist created' );
100 ok( $files{'perllocal.pod'},' perllocal.pod created' );
101}