File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -818,7 +818,10 @@ sub WriteEmptyMakefile {
818818 croak " WriteEmptyMakefile: Need an even number of args" if @_ % 2;
819819
820820 my %att = @_ ;
821+ $att {NAME } = ' Dummy' unless $att {NAME }; # eliminate pointless warnings
821822 my $self = MM-> new(\%att );
823+ require File::Path;
824+ File::Path::rmtree ' _eumm' ; # because MM->new does too much stuff
822825
823826 my $new = $self -> {MAKEFILE };
824827 my $old = $self -> {MAKEFILE_OLD };
@@ -829,7 +832,7 @@ sub WriteEmptyMakefile {
829832 _rename($new , $old ) or warn " rename $new => $old : $! "
830833 }
831834 open my $mfh , ' >' , $new or die " open $new for write: $! " ;
832- print $mfh <<'EOP' ;
835+ printf $mfh <<'EOP' , $self -> { RM_F }, $self -> { MAKEFILE } ;
833836all :
834837
835838pure_nolink :
@@ -838,7 +841,10 @@ dynamic :
838841
839842static :
840843
844+ realclean : clean
845+
841846clean :
847+ %s %s
842848
843849install :
844850
Original file line number Diff line number Diff line change @@ -12,26 +12,26 @@ use Cwd; my $cwd = getcwd; END { chdir $cwd } # so File::Temp can cleanup
1212chdir $tmpdir ;
1313
1414use strict;
15- use Test::More tests => 5 ;
15+ use Test::More tests => 6 ;
1616
1717use ExtUtils::MakeMaker qw( WriteEmptyMakefile) ;
1818use TieOut;
1919
2020can_ok __PACKAGE__ , ' WriteEmptyMakefile' ;
2121
2222eval { WriteEmptyMakefile(" something" ); };
23- like $@ , qr / Need an even number of args/ ;
24-
23+ like $@ , qr / Need an even number of args/ , ' correct exception' ;
2524
2625{
27- ok( my $stdout = tie *STDOUT , ' TieOut' );
26+ ok( ( my $stdout = tie *STDOUT , ' TieOut' ), ' tie stdout ' );
2827
29- ok !-e ' wibble' ;
28+ ok !-e ' wibble' , ' no wibble ' ;
3029 END { 1 while unlink ' wibble' }
3130
3231 WriteEmptyMakefile(
3332 NAME => " Foo" ,
3433 FIRST_MAKEFILE => " wibble" ,
3534 );
36- ok -e ' wibble' ;
35+ ok -e ' wibble' , ' yes wibble' ;
36+ ok !-d ' _eumm' , ' no _eumm lying around' ;
3737}
You can’t perform that action at this time.
0 commit comments