@@ -24,7 +24,7 @@ use ExtUtils::MM;
2424use Test::More
2525 !MM-> can_run(make()) && $ENV {PERL_CORE } && $Config {' usecrosscompile' }
2626 ? (skip_all => " cross-compiling and make not available" )
27- : (tests => 169 );
27+ : (tests => 179 );
2828use File::Find;
2929use File::Spec;
3030use File::Path;
@@ -162,7 +162,7 @@ is( $?, 0, 'install' ) || diag $install_out;
162162like( $install_out , qr / ^Installing / m );
163163
164164sub check_dummy_inst {
165- my $loc = shift ;
165+ my ( $loc , $skipsubdir ) = @_ ;
166166 my %files = ();
167167 find( sub {
168168 # do it case-insensitive for non-case preserving OSs
@@ -172,7 +172,7 @@ sub check_dummy_inst {
172172 $files {$file } = $File::Find::name ;
173173 }, $loc );
174174 ok( $files {' dummy.pm' }, ' Dummy.pm installed' );
175- ok( $files {' liar.pm' }, ' Liar.pm installed' );
175+ ok( $files {' liar.pm' }, ' Liar.pm installed' ) unless $skipsubdir ;
176176 ok( $files {' program' }, ' program installed' );
177177 ok( $files {' .packlist' }, ' packlist created' );
178178 ok( $files {' perllocal.pod' },' perllocal.pod created' );
@@ -433,6 +433,27 @@ is( $?, 0, 'realclean' ) || diag($realclean_out);
433433open (STDERR , " >&SAVERR" ) or die $! ;
434434close SAVERR;
435435
436+ # test linkext=>{LINKTYPE=>''} still installs a pure-perl installation
437+ # warning, edits the Makefile.PL so either rewrite after this or do this last
438+ my $file = ' Makefile.PL' ;
439+ my $text = slurp $file ;
440+ ok(($text =~ s #\) ;# linkext=>{LINKTYPE=>''},\n $& # ), ' successful M.PL edit' );
441+ open $fh , ' >' , $file or die " $file : $! " ;
442+ print $fh $text ;
443+ close $fh ;
444+ # now do with "Liar" subdir still there
445+ rmtree $DUMMYINST ; # so no false positive from before
446+ @mpl_out = run(qq{ $perl Makefile.PL "PREFIX=$DUMMYINST "} );
447+ $install_out = run(" $make install" );
448+ check_dummy_inst($DUMMYINST );
449+ # now clean, delete "Liar" subdir, do again
450+ $realclean_out = run(" $make realclean" );
451+ rmtree ' Liar' ;
452+ rmtree $DUMMYINST ; # so no false positive from before
453+ @mpl_out = run(qq{ $perl Makefile.PL "PREFIX=$DUMMYINST "} );
454+ $install_out = run(" $make install" );
455+ check_dummy_inst($DUMMYINST , 1);
456+
436457sub _normalize {
437458 my $hash = shift ;
438459
0 commit comments