X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fperlivp.PL;h=01fee9e2897321e114fa8f7ed6c3e149f6559ef8;hb=5b36ee8399419493970b295dd8460c19a625ac89;hp=bd182a5d4d4accdfce6c7b7c84b2a69cb3c35cd7;hpb=30111f4851efef8c1a7ef4e80201a911439242d1;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/perlivp.PL b/utils/perlivp.PL index bd182a5..01fee9e 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. @@ -33,20 +33,20 @@ $Config{'startperl'} if \$running_under_some_shell; !GROK!THIS! +print OUT "\n# perlivp $^V\n"; + # In the following, perl variables are not expanded during extraction. print OUT <<'!NO!SUBS!'; -# perlivp V 0.01 - - sub usage { warn "@_\n" if @_; 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 +56,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 +66,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 +85,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 +123,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++; @@ -174,7 +179,7 @@ foreach (qw(Config.pm ExtUtils/Installed.pm)) { $needed_there++; } else { - print "# Needed module `$_' does not appear to be properly installed ($@).\n"; + print "# Needed module `$_' does not appear to be properly installed.\n"; } $@ = undef; } @@ -199,7 +204,16 @@ if (defined($Config{'extensions'})) { my @extensions = split(/\s+/,$Config{'extensions'}); foreach (@extensions) { next if ($_ eq ''); - next if ($_ eq 'Devel/DProf'); + if ( $useithreads !~ /define/i ) { + next if ($_ eq 'threads'); + next if ($_ eq 'threads/shared'); + } + # that's a distribution name, not a module name + next if /^IO_Compress_(?:Zlib|Base)$/; + next if $_ eq 'Devel/DProf'; + # test modules + next if $_ eq 'XS/APItest'; + next if $_ eq 'XS/Typemap'; # VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@" # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@" # DProf: run perl with -d to use DProf. @@ -210,7 +224,7 @@ if (defined($Config{'extensions'})) { $extensions_there++; } else { - print "# Required module `$_' does not appear to be properly installed ($@).\n"; + print "# Required module `$_' does not appear to be properly installed.\n"; $@ = undef; } $extensions_total++; @@ -273,6 +287,12 @@ for (@modules) { $version = undef; @missing = (); @missing = $installed -> validate($_); + + # .bs files are optional + @missing = grep { ! /\.bs$/ } @missing; + # man files are often compressed + @missing = grep { ! ( -s "$_.gz" || -s "$_.bz2" ) } @missing; + if ($#missing >= 0) { print "# file",+($#missing == 0) ? '' : 's'," missing from installation:\n"; print '# ',join(' ',@missing),"\n"; @@ -294,6 +314,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; @@ -329,7 +350,7 @@ foreach (@ph_files) { $ph_there++; } else { - print "# Perl header `$_' does not appear to be properly installed ($@).\n"; + print "# Perl header `$_' does not appear to be properly installed.\n"; } $@ = undef; } @@ -343,6 +364,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 @@ -361,11 +386,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 @@ -391,6 +416,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.