summaryrefslogtreecommitdiff
path: root/t/pragma/warning.t
diff options
context:
space:
mode:
Diffstat (limited to 't/pragma/warning.t')
-rwxr-xr-xt/pragma/warning.t15
1 files changed, 11 insertions, 4 deletions
diff --git a/t/pragma/warning.t b/t/pragma/warning.t
index c197f35980..3cb5c73569 100755
--- a/t/pragma/warning.t
+++ b/t/pragma/warning.t
@@ -8,10 +8,11 @@ BEGIN {
$| = 1;
+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} }
my @prgs = () ;
@@ -39,6 +40,7 @@ for (@prgs){
my @temps = () ;
if (s/^\s*-\w+//){
$switch = $&;
+ $switch =~ s/(-\S*[A-Z]\S*)/"-$1"/ if $Is_VMS; # protect uc switches
}
my($prog,$expected) = split(/\nEXPECT\n/, $_);
if ( $prog =~ /--FILE--/) {
@@ -58,12 +60,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//) {