82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / INSTALL_BASE.t
CommitLineData
7292dc67 1#!/usr/bin/perl -w
2
2977d345 3# Tests INSTALL_BASE
7292dc67 4
5BEGIN {
b78fd716 6 unshift @INC, 't/lib';
7292dc67 7}
8
9use strict;
10use File::Path;
11use Config;
12
1487aac6 13use Test::More tests => 20;
7292dc67 14use MakeMaker::Test::Utils;
15use MakeMaker::Test::Setup::BFD;
16
17my $Is_VMS = $^O eq 'VMS';
18
19my $perl = which_perl();
20
21chdir 't';
22perl_lib;
23
24ok( setup_recurs(), 'setup' );
25END {
26 ok( chdir File::Spec->updir );
27 ok( teardown_recurs(), 'teardown' );
28}
29
30ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy") || diag("chdir failed; $!");
31
2977d345 32my @mpl_out = run(qq{$perl Makefile.PL "INSTALL_BASE=../dummy-install"});
7292dc67 33END { rmtree '../dummy-install'; }
34
35cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
36 diag(@mpl_out);
37
38my $makefile = makefile_name();
39ok( grep(/^Writing $makefile for Big::Dummy/,
40 @mpl_out) == 1,
41 'Makefile.PL output looks right');
42
43my $make = make_run();
44run("$make"); # this is necessary due to a dmake bug.
1487aac6 45my $install_out = run("$make install");
46is( $?, 0, ' make install exited normally' ) || diag $install_out;
7292dc67 47like( $install_out, qr/^Installing /m );
7292dc67 48
49ok( -r '../dummy-install', ' install dir created' );
50
51my @installed_files =
52 ('../dummy-install/lib/perl5/Big/Dummy.pm',
53 '../dummy-install/lib/perl5/Big/Liar.pm',
54 '../dummy-install/bin/program',
55 "../dummy-install/lib/perl5/$Config{archname}/perllocal.pod",
56 "../dummy-install/lib/perl5/$Config{archname}/auto/Big/Dummy/.packlist"
57 );
58
59foreach my $file (@installed_files) {
60 ok( -e $file, " $file installed" );
61 ok( -r $file, " $file readable" );
62}
63
64
65# nmake outputs its damned logo
66# Send STDERR off to oblivion.
67open(SAVERR, ">&STDERR") or die $!;
68open(STDERR, ">".File::Spec->devnull) or die $!;
69
70my $realclean_out = run("$make realclean");
71is( $?, 0, 'realclean' ) || diag($realclean_out);
72
73open(STDERR, ">&SAVERR") or die $!;
74close SAVERR;