X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fperlivp.PL;h=2e597c28f4f206c4e6707cf973cde93962bb6b9d;hb=802134916c56985ba8dc700565240474646eb9f7;hp=74a72a3476ea967c8eec40c99ddb809b44ff3982;hpb=07853d7a3689bd5640448962dc55ce2035962584;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/perlivp.PL b/utils/perlivp.PL index 74a72a3..2e597c2 100644 --- a/utils/perlivp.PL +++ b/utils/perlivp.PL @@ -14,9 +14,9 @@ use Cwd; # This forces PL files to create target in same directory as PL file. # This is so that make depend always knows where to find PL derivatives. -$origdir = cwd; +my $origdir = cwd; chdir dirname($0); -$file = basename($0, '.PL'); +my $file = basename($0, '.PL'); $file .= '.com' if $^O eq 'VMS'; # Create output file. @@ -37,7 +37,7 @@ $Config{'startperl'} print OUT <<'!NO!SUBS!'; -# perlivp V 0.01 +# perlivp V 0.02 sub usage { @@ -45,8 +45,9 @@ sub usage { print << " EOUSAGE"; Usage: - $0 [-p] [-v] | [-h] + $0 [-a] [-p] [-v] | [-h] + -a Run all tests (default is to skip .ph tests) -p Print a preface before each test telling what it will test. -v Verbose mode in which extra information about test results is printed. Test failures always print out some extra information @@ -56,7 +57,7 @@ Usage: exit; } -use vars (%opt); # allow testing with older versions (do not use our) +use vars qw(%opt); # allow testing with older versions (do not use our) @opt{ qw/? H h P p V v/ } = qw(0 0 0 0 0 0 0); @@ -66,7 +67,7 @@ while ($ARGV[0] =~ /^-/) { usage() if '?' =~ /\Q$flag/; usage() if 'h' =~ /\Q$flag/; usage() if 'H' =~ /\Q$flag/; - usage("unknown flag: `$flag'") unless 'HhPpVv' =~ /\Q$flag/; + usage("unknown flag: `$flag'") unless 'HhPpVva' =~ /\Q$flag/; warn "$0: `$flag' flag already set\n" if $opt{$flag}++; } shift; @@ -85,11 +86,16 @@ my $tests_total = 0; # Unixes it is the basename rather than the full path to the perl binary. my $perlpath = ''; if (defined($Config{'perlpath'})) { $perlpath = $Config{'perlpath'}; } -# Of course some platforms are distinct... -if ($^O eq 'VMS') { $perlpath = $^X; } + +# The useithreads Config variable plays a role in whether or not +# threads and threads/shared work when Cd. They apparently always +# get installed on systems that can run Configure. +my $useithreads = ''; +if (defined($Config{'useithreads'})) { $useithreads = $Config{'useithreads'}; } print OUT <<"!GROK!THIS!"; my \$perlpath = '$perlpath'; +my \$useithreads = '$useithreads'; !GROK!THIS! print OUT <<'!NO!SUBS!'; @@ -118,7 +124,7 @@ my \$ivp_VERSION = $]; !GROK!THIS! print OUT <<'!NO!SUBS!'; -if ($ivp_VERSION == $]) { +if ($ivp_VERSION eq $]) { print "## Perl version `$]' appears installed as expected.\n" if $opt{'v'}; print "ok 2\n"; $pass__total++; @@ -199,6 +205,10 @@ if (defined($Config{'extensions'})) { my @extensions = split(/\s+/,$Config{'extensions'}); foreach (@extensions) { next if ($_ eq ''); + if ( $useithreads !~ /define/i ) { + next if ($_ eq 'threads'); + next if ($_ eq 'threads/shared'); + } next if ($_ eq 'Devel/DProf'); # VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@" # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@" @@ -294,6 +304,7 @@ else { $tests_total++; +if ($opt{'a'}) { print "## Checking installations of *.h -> *.ph header files.\n" if $opt{'p'}; my $ph_there = 0; my $var = undef; @@ -313,6 +324,7 @@ while (($var, $val) = each %Config) { $h_file = 'sys/resource' if $h_file eq 'sysresrc'; $h_file = 'sys/select' if $h_file eq 'sysselct'; $h_file = 'sys/security' if $h_file eq 'syssecrt'; + $h_file = 'rpcsvc/dbm' if $h_file eq 'rpcsvcdbm'; # This ought to distinguish syslog from sys/syslog. # (NB syslog.ph is heavily used for the DBI pre-requisites). $h_file =~ s{^sys(\w.+)}{sys/$1} unless $h_file eq 'syslog'; @@ -342,6 +354,10 @@ else { $error_total++; } $tests_total++; +} +else { + print "## Skip checking of *.ph header files.\n" if $opt{'p'}; +} # Final report (rather than feed ousrselves to Test::Harness::runtests() # we simply format some output on our own to keep things simple and @@ -360,11 +376,11 @@ if ($error_total == 0 && $tests_total) { =head1 NAME -B - Perl Installation Verification Procedure +perlivp - Perl Installation Verification Procedure =head1 SYNOPSIS -B [B<-p>] [B<-v>] [B<-h>] +B [B<-a>] [B<-p>] [B<-v>] [B<-h>] =head1 DESCRIPTION @@ -390,6 +406,11 @@ etc. Prints out a brief help message. +=item B<-a> run all tests + +Normally tests for optional features are skipped. With -a all tests +are executed. + =item B<-p> print preface Gives a description of each test prior to performing it.