diff options
author | Craig A. Berry <craigberry@mac.com> | 2011-12-23 06:16:35 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2011-12-23 06:16:35 -0600 |
commit | 238d254681445c9b60a2a1334d374e5b187e4733 (patch) | |
tree | f209817ff4a46fb645d1f2cfb72c29263595ba94 | |
parent | 38fb5ff40a5a46393de9cee6f9aa6c9ccd151512 (diff) | |
download | perl-238d254681445c9b60a2a1334d374e5b187e4733.tar.gz |
Port utils test to VMS.
The utilities from utils.lst end with a .com extension, and the
pseudo-shebang line looks quite different.
-rw-r--r-- | t/porting/utils.t | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/t/porting/utils.t b/t/porting/utils.t index 30ffaf8aea..21a9cc68f1 100644 --- a/t/porting/utils.t +++ b/t/porting/utils.t @@ -36,6 +36,7 @@ open $fh, '<', 'utils.lst' or die "Can't open utils.lst: $!"; while (<$fh>) { die unless m!^(\S+)!; push @maybe, $1; + $maybe[$#maybe] .= '.com' if $^O eq 'VMS'; } close $fh or die $!; @@ -48,14 +49,15 @@ my %excuses = ( foreach (@maybe) { if (/\.p[lm]$/) { push @victims, $_; - } elsif ($_ ne 'x2p/a2p') { + } elsif ($_ !~ m{^x2p/a2p}) { # test_prep doesn't (yet) have a dependency on a2p, so it seems a bit # silly adding one (and forcing it to be built) just so that we can open # it and determine that it's *not* a perl program, and hence of no # further interest to us. open $fh, '<', $_ or die "Can't open '$_': $!"; my $line = <$fh>; - if ($line =~ m{^#!(?:\S*|/usr/bin/env\s+)perl}) { + if ($line =~ m{^#!(?:\S*|/usr/bin/env\s+)perl} + || $^O eq 'VMS' && $line =~ m{^\$ perl}) { push @victims, $_; } else { print "# $_ isn't a Perl script\n"; @@ -70,7 +72,7 @@ foreach my $victim (@victims) { # Not clear to me *why* it needs the BEGIN block, given what it # does, but not in an easy position to change it. skip("$victim executes code in a BEGIN block which fails for empty \@ARGV") - if $victim eq 'utils/cpanp-run-perl'; + if $victim =~ m{^utils/cpanp-run-perl}; skip ("$victim uses $excuses{$victim}, so can't test with just core modules") if $excuses{$victim}; |