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