X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FSelfStubber.t;h=b5deb142fa41a80d4695c89c794c83d9a9f9d811;hb=d5201bd266fe42b2df8b480183c08be291a1ad06;hp=2e74a022d6286d5c39239ae4d672918417d21346;hpb=83943eac2433a9cd52f114532df2a61529f109a2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Devel/SelfStubber.t b/lib/Devel/SelfStubber.t index 2e74a02..b5deb14 100644 --- a/lib/Devel/SelfStubber.t +++ b/lib/Devel/SelfStubber.t @@ -7,8 +7,10 @@ BEGIN { use strict; use Devel::SelfStubber; +use File::Spec::Functions; my $runperl = "$^X \"-I../lib\""; +$runperl =~ s|../lib|::lib:| if $^O eq 'MacOS'; # ensure correct output ordering for system() calls @@ -31,7 +33,8 @@ push @cleanup, $inlib; while () { if (/^\#{16,}\s+(.*)/) { - my $file = "$inlib/$1"; + my $f = $1; + my $file = catfile(curdir(),$inlib,$f); push @cleanup, $file; open FH, ">$file" or die $!; } else { @@ -169,8 +172,9 @@ $Devel::SelfStubber::JUST_STUBS=0; undef $/; foreach my $module (@module, 'Data', 'End') { - my $file = "$lib/$module.pm"; - open FH, "$inlib/$module.pm" or die $!; + my $file = catfile(curdir(),$lib,"$module.pm"); + my $fileo = catfile(curdir(),$inlib,"$module.pm"); + open FH, $fileo or die "Can't open $fileo: $!"; my $contents = ; close FH or die $!; push @cleanup, $file; @@ -210,7 +214,7 @@ system "$runperl -w \"-I$lib\" \"-MData\" -e \"Data::ok\""; system "$runperl -w \"-I$lib\" \"-MEnd\" -e \"End::lime\""; # But check that the documentation after the __END__ survived. -open FH, "$lib/End.pm" or die $!; +open FH, catfile(curdir(),$lib,"End.pm") or die $!; $_ = ; close FH or die $!;