From 238d254681445c9b60a2a1334d374e5b187e4733 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Fri, 23 Dec 2011 06:16:35 -0600 Subject: [PATCH] Port utils test to VMS. The utilities from utils.lst end with a .com extension, and the pseudo-shebang line looks quite different. --- t/porting/utils.t | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/porting/utils.t b/t/porting/utils.t index 30ffaf8..21a9cc6 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}; -- 2.7.4