From: Jerry D. Hedden Date: Tue, 9 Sep 2008 11:52:45 +0000 (-0400) Subject: Fix parallel testing temp filenames X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0642d82a230efbe169e4a441b6943c36ff880a90;p=p5sagit%2Fp5-mst-13.2.git Fix parallel testing temp filenames From: "Jerry D. Hedden" Message-ID: <1ff86f510809090852radb1044k43ff848c2d1e11fa@mail.gmail.com> Date: Tue, 9 Sep 2008 11:52:45 -0400 p4raw-id: //depot/perl@34328 --- diff --git a/lib/charnames.t b/lib/charnames.t index d013907..4889562 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -271,10 +271,9 @@ print "ok 46\n"; # ---- Alias extensions -my $tmpfile = "tmp0000"; +my $tmpfile = tempfile(); my $alifile = File::Spec->catfile(File::Spec->updir, qw(lib unicore xyzzy_alias.pl)); my $i = 0; -1 while -e ++$tmpfile; END { if ($tmpfile) { 1 while unlink $tmpfile; } } my @prgs; diff --git a/lib/strict.t b/lib/strict.t index 16dcbec..1176be8 100644 --- a/lib/strict.t +++ b/lib/strict.t @@ -4,6 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; $ENV{PERL5LIB} = '../lib'; + require './test.pl'; } $| = 1; @@ -11,9 +12,8 @@ $| = 1; my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; -my $tmpfile = "tmp0000"; +my $tmpfile = tempfile(); my $i = 0 ; -1 while -e ++$tmpfile; END { if ($tmpfile) { 1 while unlink $tmpfile; } } my @prgs = () ; @@ -78,7 +78,7 @@ for (@prgs){ my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN - $results =~ s/tmp\d+/-/g; + $results =~ s/tmp\d+[A-Z][A-Z]?/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg $expected =~ s/\n+$//; $expected =~ s|(\./)?abc\.pm|:abc.pm|g if $^O eq 'MacOS'; diff --git a/lib/subs.t b/lib/subs.t index 92f4302..7952c20 100644 --- a/lib/subs.t +++ b/lib/subs.t @@ -4,6 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; $ENV{PERL5LIB} = '../lib'; + require './test.pl'; } $| = 1; @@ -15,9 +16,8 @@ my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; my $Is_MacOS = $^O eq 'MacOS'; -my $tmpfile = "tmp0000"; +my $tmpfile = tempfile(); my $i = 0 ; -1 while -e ++$tmpfile; END { if ($tmpfile) { 1 while unlink $tmpfile} } for (@prgs){ @@ -59,7 +59,7 @@ for (@prgs){ my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN - $results =~ s/tmp\d+/-/g; + $results =~ s/tmp\d+[A-Z][A-Z]?/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'.