summaryrefslogtreecommitdiff
path: root/t/pragma/subs.t
diff options
context:
space:
mode:
Diffstat (limited to 't/pragma/subs.t')
-rwxr-xr-xt/pragma/subs.t14
1 files changed, 10 insertions, 4 deletions
diff --git a/t/pragma/subs.t b/t/pragma/subs.t
index cf936d2b9f..33180066e0 100755
--- a/t/pragma/subs.t
+++ b/t/pragma/subs.t
@@ -11,10 +11,11 @@ undef $/;
my @prgs = split "\n########\n", <DATA>;
print "1..", scalar @prgs, "\n";
+my $Is_VMS = $^O eq 'VMS';
my $tmpfile = "tmp0000";
my $i = 0 ;
1 while -f ++$tmpfile;
-END { unlink $tmpfile if $tmpfile; }
+END { if ($tmpfile) { 1 while unlink $tmpfile} }
for (@prgs){
my $switch = "";
@@ -40,12 +41,17 @@ for (@prgs){
shift @files ;
$prog = shift @files ;
}
- open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1";
- print TEST $prog, "\n";
+ open TEST, ">$tmpfile";
+ print TEST $prog,"\n";
close TEST;
+ my $results = $Is_VMS ?
+ `MCR $^X $switch $tmpfile` :
+ `sh -c './perl $switch $tmpfile' 2>&1`;
my $status = $?;
- my $results = `cat $tmpfile`;
$results =~ s/\n+$//;
+ # allow expected output to be written as if $prog is on STDIN
+ $results =~ s/tmp\d+/-/g;
+ $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg
$expected =~ s/\n+$//;
my $prefix = ($results =~ s/^PREFIX\n//) ;
if ( $results =~ s/^SKIPPED\n//) {