From: Yves Orton Date: Mon, 27 Jul 2009 21:51:07 +0000 (+0200) Subject: cleanup the EUI/EUMM test mess, and bump Install.pm to 1.54 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16f0d0fcc43b16d1afa4a05a4599655310733b2c;p=p5sagit%2Fp5-mst-13.2.git cleanup the EUI/EUMM test mess, and bump Install.pm to 1.54 This removes lib/ExtUtils/t/basic.pl and t/basic_finish.pl, and replaces them with the EUI specific t/InstallWithMM.t. The version bump is purely to allow the release the new version on CPAN and to make it possible to include a non dev release in Perl 5.10.1 if Dave wants to. Note that while there are no real code changes in this commit I did trim whitespace from Install.pm, so if you want to see the real diff here please use diff -w. --- diff --git a/MANIFEST b/MANIFEST index 8418f61..437c910 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2219,9 +2219,7 @@ lib/ExtUtils/README MakeMaker README lib/ExtUtils/t/00compile.t See if MakeMaker modules compile lib/ExtUtils/t/arch_check.t Test MakeMaker's arch_check() lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility -lib/ExtUtils/t/basic_finish.pl See if MakeMaker can build a module (part 2) -lib/ExtUtils/t/basic.pl See if MakeMaker can build a module (part 1) -lib/ExtUtils/t/basic.t See if MakeMaker can build a module (wrapper for basic.pl and basic_finish.pl) +lib/ExtUtils/t/basic.t See if MakeMaker can build a module lib/ExtUtils/t/build_man.t Set if MakeMaker builds manpages lib/ExtUtils/t/can_write_dir.t Does the _can_write_dir function of ExtUtils::Install work properly? lib/ExtUtils/t/cd.t Test to see cd works @@ -2241,6 +2239,7 @@ lib/ExtUtils/t/INSTALL_BASE.t Test INSTALL_BASE in MakeMaker lib/ExtUtils/t/installed_file.t Test for ExtUtils::MakeMaker lib/ExtUtils/t/Installed.t See if ExtUtils::Installed works lib/ExtUtils/t/Install.t See if ExtUtils::Install works +lib/ExtUtils/t/InstallWithMM.t See if ExtUtils::Install works (related to EUMM/t/basic.t) lib/ExtUtils/t/INST_PREFIX.t See if MakeMaker can apply PREFIXs lib/ExtUtils/t/INST.t Check MakeMaker INST_* macros lib/ExtUtils/t/is_of_type.t Test for ExtUtils::MakeMaker diff --git a/lib/ExtUtils/Changes_EU-Install b/lib/ExtUtils/Changes_EU-Install index d50a63e..55c6013 100644 --- a/lib/ExtUtils/Changes_EU-Install +++ b/lib/ExtUtils/Changes_EU-Install @@ -1,5 +1,20 @@ Revision history for ExtUtils-Install +1.54 + +This is a "no-change" version bump because I pushed the v1.53 change +and then realized that MakeMaker.t was a bad name for a file that would +end up in core where the EUMM tests and the EUI tests are in the same +directory. This renames it to InstallWithMM.t. + +1.53 + +Final stage of the divorce from EUMM. Now the EUMM related tests are no +longer shared. Build.pl and Build.t go, and there shall be peace on earth. +At least until somebody patches EUMM/t/basic.t for something EUI related... + +Thanks to M. Schwern for helping me work this one out. Cheers man. + 1.52_03 Missed the t/Installed.t test from core. Bumped version number to allow diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index 5ee9f37..c886c69 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -20,7 +20,7 @@ use File::Spec; @ISA = ('Exporter'); @EXPORT = ('install','uninstall','pm_to_blib', 'install_default'); -=pod +=pod =head1 NAME @@ -35,14 +35,14 @@ ExtUtils::Install - install files from here to there uninstall($packlist); pm_to_blib({ 'lib/Foo/Bar.pm' => 'blib/lib/Foo/Bar.pm' }); - + =head1 VERSION -1.52 +1.54 =cut -$VERSION = '1.52_03'; +$VERSION = '1.54'; # <---- dont forget to update the POD section just above this line! $VERSION = eval $VERSION; =pod @@ -111,11 +111,11 @@ my $CanMoveAtBoot = ($Is_Win32 || $Is_cygwin); my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || ''; my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || ''; my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || ''; - $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i; + $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i; $vms_efs = $efs_charset =~ /^[ET1]/i; $vms_case = $efs_case =~ /^[ET1]/i; } - $Is_VMS_noefs = 0 if ($vms_efs); + $Is_VMS_noefs = 0 if ($vms_efs); } @@ -384,7 +384,7 @@ Abstract a -w check that tries to use POSIX::access() if possible. my $dir=shift; unless (defined $has_posix) { $has_posix= (!$Is_cygwin && !$Is_Win32 - && eval 'local $^W; require POSIX; 1') || 0; + && eval 'local $^W; require POSIX; 1') || 0; } if ($has_posix) { return POSIX::access($dir, POSIX::W_OK()); @@ -500,7 +500,7 @@ sub _mkpath { } elsif ($show and $dry_run) { print "$_\n" for @make; } - + } =pod @@ -562,20 +562,20 @@ sub _chdir { # deprecated forms install(\%from_to); - install(\%from_to, $verbose, $dry_run, $uninstall_shadows, + install(\%from_to, $verbose, $dry_run, $uninstall_shadows, $skip, $always_copy, \%result); - # recommended form as of 1.47 - install([ + # recommended form as of 1.47 + install([ from_to => \%from_to, - verbose => 1, + verbose => 1, dry_run => 0, uninstall_shadows => 1, skip => undef, always_copy => 1, result => \%install_results, ]); - + Copies each directory tree of %from_to to its corresponding value preserving timestamps and permissions. @@ -598,22 +598,22 @@ without actually doing it. Default is false. If $uninstall_shadows is true any differing versions throughout @INC will be uninstalled. This is "make install UNINST=1" -As of 1.37_02 install() supports the use of a list of patterns to filter out -files that shouldn't be installed. If $skip is omitted or undefined then -install will try to read the list from INSTALL.SKIP in the CWD. This file is -a list of regular expressions and is just like the MANIFEST.SKIP file used +As of 1.37_02 install() supports the use of a list of patterns to filter out +files that shouldn't be installed. If $skip is omitted or undefined then +install will try to read the list from INSTALL.SKIP in the CWD. This file is +a list of regular expressions and is just like the MANIFEST.SKIP file used by L. -A default site INSTALL.SKIP may be provided by setting then environment -variable EU_INSTALL_SITE_SKIPFILE, this will only be used when there isn't a -distribution specific INSTALL.SKIP. If the environment variable -EU_INSTALL_IGNORE_SKIP is true then no install file filtering will be +A default site INSTALL.SKIP may be provided by setting then environment +variable EU_INSTALL_SITE_SKIPFILE, this will only be used when there isn't a +distribution specific INSTALL.SKIP. If the environment variable +EU_INSTALL_IGNORE_SKIP is true then no install file filtering will be performed. -If $skip is undefined then the skip file will be autodetected and used if it -is found. If $skip is a reference to an array then it is assumed the array -contains the list of patterns, if $skip is a true non reference it is -assumed to be the filename holding the list of patterns, any other value of +If $skip is undefined then the skip file will be autodetected and used if it +is found. If $skip is a reference to an array then it is assumed the array +contains the list of patterns, if $skip is a true non reference it is +assumed to be the filename holding the list of patterns, any other value of $skip is taken to mean that no install filtering should occur. B @@ -621,32 +621,32 @@ B As of version 1.47 the following additions were made to the install interface. Note that the new argument style and use of the %result hash is recommended. -The $always_copy parameter which when true causes files to be updated -regardles as to whether they have changed, if it is defined but false then -copies are made only if the files have changed, if it is undefined then the +The $always_copy parameter which when true causes files to be updated +regardles as to whether they have changed, if it is defined but false then +copies are made only if the files have changed, if it is undefined then the value of the environment variable EU_INSTALL_ALWAYS_COPY is used as default. -The %result hash will be populated with the various keys/subhashes reflecting +The %result hash will be populated with the various keys/subhashes reflecting the install. Currently these keys and their structure are: install => { $target => $source }, install_fail => { $target => $source }, install_unchanged => { $target => $source }, - + install_filtered => { $source => $pattern }, - + uninstall => { $uninstalled => $source }, uninstall_fail => { $uninstalled => $source }, - + where C<$source> is the filespec of the file being installed. C<$target> is where it is being installed to, and C<$uninstalled> is any shadow file that is in C<@INC> or C<$ENV{PERL5LIB}> or other standard locations, and C<$pattern> is the pattern that caused a source file to be skipped. In future more keys will be added, such as to -show created directories, however this requires changes in other modules and must +show created directories, however this requires changes in other modules and must therefore wait. - -These keys will be populated before any exceptions are thrown should there be an -error. + +These keys will be populated before any exceptions are thrown should there be an +error. Note that all updates of the %result are additive, the hash will not be cleared before use, thus allowing status results of many installs to be easily @@ -655,7 +655,7 @@ aggregated. B If there is only one argument and it is a reference to an array then -the array is assumed to contain a list of key-value pairs specifying +the array is assumed to contain a list of key-value pairs specifying the options. In this case the option "from_to" is mandatory. This style means that you dont have to supply a cryptic list of arguments and can use a self documenting argument list that is easier to understand. @@ -664,10 +664,10 @@ This is now the recommended interface to install(). B -If all actions were successful install will return a hashref of the results -as described above for the $result parameter. If any action is a failure -then install will die, therefore it is recommended to pass in the $result -parameter instead of using the return value. If the result parameter is +If all actions were successful install will return a hashref of the results +as described above for the $result parameter. If any action is a failure +then install will die, therefore it is recommended to pass in the $result +parameter instead of using the return value. If the result parameter is provided then the returned hashref will be the passed in hashref. =cut @@ -676,7 +676,7 @@ sub install { #XXX OS-SPECIFIC my($from_to,$verbose,$dry_run,$uninstall_shadows,$skip,$always_copy,$result) = @_; if (@_==1 and eval { 1+@$from_to }) { my %opts = @$from_to; - $from_to = $opts{from_to} + $from_to = $opts{from_to} or Carp::confess("from_to is a mandatory parameter"); $verbose = $opts{verbose}; $dry_run = $opts{dry_run}; @@ -685,14 +685,14 @@ sub install { #XXX OS-SPECIFIC $always_copy = $opts{always_copy}; $result = $opts{result}; } - + $result ||= {}; $verbose ||= 0; $dry_run ||= 0; $skip= _get_install_skip($skip,$verbose); $always_copy = $ENV{EU_INSTALL_ALWAYS_COPY} - || $ENV{EU_ALWAYS_COPY} + || $ENV{EU_ALWAYS_COPY} || 0 unless defined $always_copy; @@ -710,7 +710,7 @@ sub install { #XXX OS-SPECIFIC my $cwd = cwd(); my @found_files; my %check_dirs; - + MOD_INSTALL: foreach my $source (sort keys %from_to) { #copy the tree to the target directory without altering #timestamp and permission and remember for the .packlist @@ -762,7 +762,7 @@ sub install { #XXX OS-SPECIFIC } # we have to do this for back compat with old File::Finds # and because the target is relative - my $save_cwd = _chdir($cwd); + my $save_cwd = _chdir($cwd); my $diff = 0; # XXX: I wonder how useful this logic is actually -- demerphq if ( $always_copy or !-f $targetfile or -s $targetfile != $size) { @@ -771,28 +771,28 @@ sub install { #XXX OS-SPECIFIC # we might not need to copy this file $diff = compare($sourcefile, $targetfile); } - $check_dirs{$targetdir}++ + $check_dirs{$targetdir}++ unless -w $targetfile; - + push @found_files, [ $diff, $File::Find::dir, $origfile, $mode, $size, $atime, $mtime, $targetdir, $targetfile, $sourcedir, $sourcefile, - - ]; + + ]; #restore the original directory we were in when File::Find #called us so that it doesnt get horribly confused. - _chdir($save_cwd); - }, $current_directory ); + _chdir($save_cwd); + }, $current_directory ); _chdir($cwd); - } + } foreach my $targetdir (sort keys %check_dirs) { _mkpath( $targetdir, 0, 0755, $verbose, $dry_run ); } foreach my $found (@found_files) { my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime, $targetdir, $targetfile, $sourcedir, $sourcefile)= @$found; - + my $realtarget= $targetfile; if ($diff) { eval { @@ -804,15 +804,15 @@ sub install { #XXX OS-SPECIFIC _mkpath( $targetdir, 0, 0755, $verbose, $dry_run ); } print "Installing $targetfile\n"; - + _copy( $sourcefile, $targetfile, $verbose, $dry_run, ); - - + + #XXX OS-SPECIFIC print "utime($atime,$mtime,$targetfile)\n" if $verbose>1; utime($atime,$mtime + $Is_VMS,$targetfile) unless $dry_run>1; - - + + $mode = 0444 | ( $mode & 0111 ? 0111 : 0 ); $mode = $mode | 0222 if $realtarget ne $targetfile; @@ -1001,7 +1001,7 @@ sub install_default { $INST_SCRIPT => $Config{installscript}, $INST_MAN1DIR => $Config{installman1dir}, $INST_MAN3DIR => $Config{installman3dir}, - @INST_HTML, + @INST_HTML, },1,0,0); } @@ -1066,17 +1066,17 @@ sub inc_uninstall { $ignore||=""; my $file = (File::Spec->splitpath($filepath))[2]; my %seen_dir = (); - + my @PERL_ENV_LIB = split $Config{path_sep}, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || ''; - - my @dirs=( @PERL_ENV_LIB, - @INC, + + my @dirs=( @PERL_ENV_LIB, + @INC, @Config{qw(archlibexp privlibexp sitearchexp - sitelibexp)}); - + sitelibexp)}); + #warn join "\n","---",@dirs,"---"; my $seen_ours; foreach $dir ( @dirs ) { @@ -1116,7 +1116,7 @@ sub inc_uninstall { } else { print "Unlinking $targetfile (shadowing?)\n" if $verbose; eval { - die "Fake die for testing" + die "Fake die for testing" if $ExtUtils::Install::Testing and ucase(File::Spec->canonpath($ExtUtils::Install::Testing)) eq ucase($targetfile); forceunlink($targetfile,'tryhard'); @@ -1124,7 +1124,7 @@ sub inc_uninstall { 1; } or do { $results->{fail_uninstall}{$targetfile} = $filepath; - if ($seen_ours) { + if ($seen_ours) { warn "Failed to remove probably harmless shadow file '$targetfile'\n"; } else { die "$@\n"; @@ -1329,7 +1329,7 @@ always overwrite older identical files during the install process. Note that the alias EU_ALWAYS_COPY will be supported if EU_INSTALL_ALWAYS_COPY is not defined until at least the 1.50 release. Please ensure you use the -correct EU_INSTALL_ALWAYS_COPY. +correct EU_INSTALL_ALWAYS_COPY. =back diff --git a/lib/ExtUtils/t/InstallWithMM.t b/lib/ExtUtils/t/InstallWithMM.t new file mode 100644 index 0000000..354b8f4 --- /dev/null +++ b/lib/ExtUtils/t/InstallWithMM.t @@ -0,0 +1,95 @@ +#!/usr/bin/perl -w + +# Make sure EUI works with MakeMaker + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Config; +use ExtUtils::MakeMaker; + +use Test::More tests => 15; +use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::BFD; +use File::Find; +use File::Spec; +use File::Path; + +my $make = make_run(); + +# Environment variables which interfere with our testing. +delete @ENV{qw(PREFIX LIB MAKEFLAGS)}; + +# Run Makefile.PL +{ + my $perl = which_perl(); + my $Is_VMS = $^O eq 'VMS'; + + chdir 't'; + + perl_lib; + + my $Touch_Time = calibrate_mtime(); + + $| = 1; + + ok( setup_recurs(), 'setup' ); + END { + ok( chdir File::Spec->updir ); + ok( teardown_recurs(), 'teardown' ); + } + + ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) || + diag("chdir failed: $!"); + + my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"}); + END { rmtree '../dummy-install'; } + + cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || + diag(@mpl_out); + + END { unlink makefile_name(), makefile_backup() } +} + + +# make +{ + my $make_out = run($make); + is( $?, 0, 'make ran ok' ) || + diag($make_out); +} + + +# Test 'make install VERBINST=1' +{ + my $make_install_verbinst = make_macro($make, 'install', VERBINST => 1); + my $install_out = run($make_install_verbinst); + is( $?, 0, 'install' ) || diag $install_out; + like( $install_out, qr/^Installing /m ); + like( $install_out, qr/^Writing /m ); + + ok( -r '../dummy-install', ' install dir created' ); + my %files = (); + find( sub { + # do it case-insensitive for non-case preserving OSs + my $file = lc $_; + + # VMS likes to put dots on the end of things that don't have them. + $file =~ s/\.$// if $Is_VMS; + + $files{$file} = $File::Find::name; + }, '../dummy-install' ); + ok( $files{'dummy.pm'}, ' Dummy.pm installed' ); + ok( $files{'liar.pm'}, ' Liar.pm installed' ); + ok( $files{'program'}, ' program installed' ); + ok( $files{'.packlist'}, ' packlist created' ); + ok( $files{'perllocal.pod'},' perllocal.pod created' ); +} diff --git a/lib/ExtUtils/t/basic.pl b/lib/ExtUtils/t/basic.pl deleted file mode 100644 index d09a288..0000000 --- a/lib/ExtUtils/t/basic.pl +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -w - -# *NOTE* This is executed by basic.t and is included in both ExtUtils-Install -# and ExtUtils-MakeMaker as well as Perl itself. Which bits of it execute depend -# on each given packages basic.t -# -# If you patch any version of this file please make sure you let the other -# distributions know as well. It should be identical in all three cases. - -# This test puts MakeMaker through the paces of a basic perl module -# build, test and installation of the Big::Fat::Dummy module. - -use strict; -use Config; -use ExtUtils::MakeMaker; - -use Test::More tests => $::TESTS; -use MakeMaker::Test::Utils; -use MakeMaker::Test::Setup::BFD; -use File::Find; -use File::Spec; -use File::Path; - -# 'make disttest' sets a bunch of environment variables which interfere -# with our testing. -delete @ENV{qw(PREFIX LIB MAKEFLAGS)}; - -my $perl = which_perl(); -my $Is_VMS = $^O eq 'VMS'; - -# GNV logical interferes with testing -$ENV{'bin'} = '[.bin]' if $Is_VMS; - -chdir 't'; - -perl_lib; - -my $Touch_Time = calibrate_mtime(); - -$| = 1; - -ok( setup_recurs(), 'setup' ); -END { - ok( chdir File::Spec->updir ); - ok( teardown_recurs(), 'teardown' ); -} - -ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) || - diag("chdir failed: $!"); - -my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"}); -END { rmtree '../dummy-install'; } - -cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || - diag(@mpl_out); - -my $makefile = makefile_name(); -ok( grep(/^Writing $makefile for Big::Dummy/, - @mpl_out) == 1, - 'Makefile.PL output looks right'); - -ok( grep(/^Current package is: main$/, - @mpl_out) == 1, - 'Makefile.PL run in package main'); - -ok( -e $makefile, 'Makefile exists' ); - -# -M is flakey on VMS -my $mtime = (stat($makefile))[9]; -cmp_ok( $Touch_Time, '<=', $mtime, ' its been touched' ); - -END { unlink makefile_name(), makefile_backup() } - -my $make = make_run(); - -{ - # Supress 'make manifest' noise - local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0; - my $manifest_out = run("$make manifest"); - ok( -e 'MANIFEST', 'make manifest created a MANIFEST' ); - ok( -s 'MANIFEST', ' its not empty' ); -} - -END { unlink 'MANIFEST'; } - -unless ($::TEST_INSTALL_ONLY) { - my $ppd_out = run("$make ppd"); - is( $?, 0, ' exited normally' ) || diag $ppd_out; - ok( open(PPD, 'Big-Dummy.ppd'), ' .ppd file generated' ); - my $ppd_html; - { local $/; $ppd_html = } - close PPD; - like( $ppd_html, qr{^}m, - ' ' ); - like( $ppd_html, qr{^\s*Big-Dummy}m, ' ' ); - like( $ppd_html, qr{^\s*<ABSTRACT>Try "our" hot dog's</ABSTRACT>}m, # Unconfuse highlighters: ' - ' <ABSTRACT>'); - like( $ppd_html, - qr{^\s*<AUTHOR>Michael G Schwern <schwern\@pobox.com></AUTHOR>}m, - ' <AUTHOR>' ); - like( $ppd_html, qr{^\s*<IMPLEMENTATION>}m, ' <IMPLEMENTATION>'); - like( $ppd_html, qr{^\s*<DEPENDENCY NAME="strict" VERSION="0,0,0,0" />}m, - ' <DEPENDENCY>' ); - like( $ppd_html, qr{^\s*<OS NAME="$Config{osname}" />}m, - ' <OS>' ); - my $archname = $Config{archname}; - $archname .= "-". substr($Config{version},0,3) if $] >= 5.008; - like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$archname" />}m, - ' <ARCHITECTURE>'); - like( $ppd_html, qr{^\s*<CODEBASE HREF="" />}m, ' <CODEBASE>'); - like( $ppd_html, qr{^\s*</IMPLEMENTATION>}m, ' </IMPLEMENTATION>'); - like( $ppd_html, qr{^\s*</SOFTPKG>}m, ' </SOFTPKG>'); - END { unlink 'Big-Dummy.ppd' } -} - -my $test_out = run("$make test"); -like( $test_out, qr/All tests successful/, 'make test' ); -is( $?, 0, ' exited normally' ) || - diag $test_out; - -# Test 'make test TEST_VERBOSE=1' -my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1); -$test_out = run("$make_test_verbose"); -like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' ); -like( $test_out, qr/All tests successful/, ' successful' ); -is( $?, 0, ' exited normally' ) || - diag $test_out; - -# Test 'make install VERBINST=1' -my $make_install_verbinst = make_macro($make, 'install', VERBINST => 1); -my $install_out = run($make_install_verbinst); -is( $?, 0, 'install' ) || diag $install_out; -like( $install_out, qr/^Installing /m ); -like( $install_out, qr/^Writing /m ); - -ok( -r '../dummy-install', ' install dir created' ); -my %files = (); -find( sub { - # do it case-insensitive for non-case preserving OSs - my $file = lc $_; - - # VMS likes to put dots on the end of things that don't have them. - $file =~ s/\.$// if $Is_VMS; - - $files{$file} = $File::Find::name; -}, '../dummy-install' ); -ok( $files{'dummy.pm'}, ' Dummy.pm installed' ); -ok( $files{'liar.pm'}, ' Liar.pm installed' ); -ok( $files{'program'}, ' program installed' ); -ok( $files{'.packlist'}, ' packlist created' ); -ok( $files{'perllocal.pod'},' perllocal.pod created' ); - - -SKIP: { - skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS; - - $install_out = run("$make install PREFIX=elsewhere VERBINST=1"); - is( $?, 0, 'install with PREFIX override' ) || diag $install_out; - like( $install_out, qr/^Installing /m ); - like( $install_out, qr/^Writing /m ); - - ok( -r 'elsewhere', ' install dir created' ); - %files = (); - find( sub { $files{$_} = $File::Find::name; }, 'elsewhere' ); - ok( $files{'Dummy.pm'}, ' Dummy.pm installed' ); - ok( $files{'Liar.pm'}, ' Liar.pm installed' ); - ok( $files{'program'}, ' program installed' ); - ok( $files{'.packlist'}, ' packlist created' ); - ok( $files{'perllocal.pod'},' perllocal.pod created' ); - rmtree('elsewhere'); -} - - -SKIP: { - skip 'VMS install targets do not preserve $(DESTDIR)', 11 if $Is_VMS; - - $install_out = run("$make install PREFIX= DESTDIR=other VERBINST=1"); - is( $?, 0, 'install with DESTDIR' ) || - diag $install_out; - like( $install_out, qr/^Installing /m ); - like( $install_out, qr/^Writing /m ); - - ok( -d 'other', ' destdir created' ); - %files = (); - my $perllocal; - find( sub { - $files{$_} = $File::Find::name; - }, 'other' ); - ok( $files{'Dummy.pm'}, ' Dummy.pm installed' ); - ok( $files{'Liar.pm'}, ' Liar.pm installed' ); - ok( $files{'program'}, ' program installed' ); - ok( $files{'.packlist'}, ' packlist created' ); - ok( $files{'perllocal.pod'},' perllocal.pod created' ); - - ok( open(PERLLOCAL, $files{'perllocal.pod'} ) ) || - diag("Can't open $files{'perllocal.pod'}: $!"); - { local $/; - unlike(<PERLLOCAL>, qr/other/, 'DESTDIR should not appear in perllocal'); - } - close PERLLOCAL; - -# TODO not available in the min version of Test::Harness we require -# ok( open(PACKLIST, $files{'.packlist'} ) ) || -# diag("Can't open $files{'.packlist'}: $!"); -# { local $/; -# local $TODO = 'DESTDIR still in .packlist'; -# unlike(<PACKLIST>, qr/other/, 'DESTDIR should not appear in .packlist'); -# } -# close PACKLIST; - - rmtree('other'); -} - - -SKIP: { - skip 'VMS install targets do not preserve $(PREFIX)', 10 if $Is_VMS; - - $install_out = run("$make install PREFIX=elsewhere DESTDIR=other/ VERBINST=1"); - is( $?, 0, 'install with PREFIX override and DESTDIR' ) || - diag $install_out; - like( $install_out, qr/^Installing /m ); - like( $install_out, qr/^Writing /m ); - - ok( !-d 'elsewhere', ' install dir not created' ); - ok( -d 'other/elsewhere', ' destdir created' ); - %files = (); - find( sub { $files{$_} = $File::Find::name; }, 'other/elsewhere' ); - ok( $files{'Dummy.pm'}, ' Dummy.pm installed' ); - ok( $files{'Liar.pm'}, ' Liar.pm installed' ); - ok( $files{'program'}, ' program installed' ); - ok( $files{'.packlist'}, ' packlist created' ); - ok( $files{'perllocal.pod'},' perllocal.pod created' ); - rmtree('other'); -} - diff --git a/lib/ExtUtils/t/basic_finish.pl b/lib/ExtUtils/t/basic_finish.pl deleted file mode 100644 index 7cc4e8a..0000000 --- a/lib/ExtUtils/t/basic_finish.pl +++ /dev/null @@ -1,104 +0,0 @@ -# *NOTE* This is executed by basic.t and is included in both ExtUtils-MakeMaker -# as well as Perlcore. Note also that it is expected to be executed in a do "FILE" -# immediately after basic.plt is executed (similarly). - -# It is NOT expected to be executed under ExtUtils-Install alone, and in fact is not -# distributed there, however it is expected to be executed under ExtUtils-MakeMaker -# and Perl itself. - -my $dist_test_out = run("$make disttest"); -is( $?, 0, 'disttest' ) || diag($dist_test_out); - -# Test META.yml generation -use ExtUtils::Manifest qw(maniread); - -my $distdir = 'Big-Dummy-0.01'; -$distdir =~ s/\./_/g if $Is_VMS; -my $meta_yml = "$distdir/META.yml"; - -ok( !-f 'META.yml', 'META.yml not written to source dir' ); -ok( -f $meta_yml, 'META.yml written to dist dir' ); -ok( !-e "META_new.yml", 'temp META.yml file not left around' ); - -SKIP: { - # META.yml spec 1.4 was added in 0.11 - skip "Test::YAML::Meta >= 0.11 required", 2 - unless eval { require Test::YAML::Meta } and - Test::YAML::Meta->VERSION >= 0.11; - - Test::YAML::Meta::meta_spec_ok($meta_yml); -} - -ok open META, $meta_yml or diag $!; -my $meta = join '', <META>; -ok close META; - -is $meta, <<"END"; ---- #YAML:1.0 -name: Big-Dummy -version: 0.01 -abstract: Try "our" hot dog's -author: - - Michael G Schwern <schwern\@pobox.com> -license: unknown -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 -requires: - strict: 0 -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 -END - -my $manifest = maniread("$distdir/MANIFEST"); -# VMS is non-case preserving, so we can't know what the MANIFEST will -# look like. :( -_normalize($manifest); -is( $manifest->{'meta.yml'}, 'Module meta-data (added by MakeMaker)' ); - - -# Test NO_META META.yml suppression -unlink $meta_yml; -ok( !-f $meta_yml, 'META.yml deleted' ); -@mpl_out = run(qq{$perl Makefile.PL "NO_META=1"}); -cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); -my $distdir_out = run("$make distdir"); -is( $?, 0, 'distdir' ) || diag($distdir_out); -ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' ); - - -# Make sure init_dirscan doesn't go into the distdir -@mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"}); - -cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); - -ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1, - 'init_dirscan skipped distdir') || - diag(@mpl_out); - -# I know we'll get ignored errors from make here, that's ok. -# Send STDERR off to oblivion. -open(SAVERR, ">&STDERR") or die $!; -open(STDERR, ">".File::Spec->devnull) or die $!; - -my $realclean_out = run("$make realclean"); -is( $?, 0, 'realclean' ) || diag($realclean_out); - -open(STDERR, ">&SAVERR") or die $!; -close SAVERR; - - -sub _normalize { - my $hash = shift; - - while(my($k,$v) = each %$hash) { - delete $hash->{$k}; - $hash->{lc $k} = $v; - } -}