#!/import/archperf/ws/devtools/4/amd64/bin/perl
eval 'exec /import/archperf/ws/devtools/4/amd64/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
-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
regardless of whether or not this switch is set.
-h Prints this help message.
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);
while ($ARGV[0] =~ /^-/) {
for my $flag (split(//,$ARGV[0])) {
usage() if '?' =~ /\Q$flag/;
usage() if 'h' =~ /\Q$flag/;
usage() if 'H' =~ /\Q$flag/;
usage("unknown flag: `$flag'") unless 'HhPpVva' =~ /\Q$flag/;
warn "$0: `$flag' flag already set\n" if $opt{$flag}++;
my $perlpath = '/import/archperf/ws/devtools/4/amd64/bin/perl';
print "## Checking Perl binary via variable `\$perlpath' = $perlpath.\n" if $opt{'p'};
print "## Perl binary `$perlpath' appears executable.\n" if $opt{'v'};
print "# Perl binary `$perlpath' does not appear executable.\n";
print "## Checking Perl version via variable `\$]'.\n" if $opt{'p'};
my $ivp_VERSION = 5.008008;
if ($ivp_VERSION eq $]) {
print "## Perl version `$]' appears installed as expected.\n" if $opt{'v'};
print "# Perl version `$]' installed, expected $ivp_VERSION.\n";
print "## Checking roots of the Perl library directory tree via variable `\@INC'.\n" if $opt{'p'};
next if $_ eq '.'; # skip -d test here
next if $_ eq ':'; # skip -d test here
next if $_ eq 'Dev:Pseudo:'; # why is this in @INC?
print "## Perl \@INC directory `$_' exists.\n" if $opt{'v'};
print "# Perl \@INC directory `$_' does not appear to exist.\n";
if ($INC_total == $INC_there) {
print "## Checking installations of modules necessary for ivp.\n" if $opt{'p'};
foreach (qw(Config.pm ExtUtils/Installed.pm)) {
print "## Module `$_' appears to be installed.\n" if $opt{'v'};
print "# Needed module `$_' does not appear to be properly installed.\n";
if ($needed_total == $needed_there) {
print "## Checking installations of extensions built with perl.\n" if $opt{'p'};
my $extensions_total = 0;
my $extensions_there = 0;
if (defined($Config{'extensions'})) {
my @extensions = split(/\s+/,$Config{'extensions'});
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 $@"
# DProf: run perl with -d to use DProf.
# Compilation failed in require at (eval 1) line 1.
eval " require \"$_.pm\"; ";
print "## Module `$_' appears to be installed.\n" if $opt{'v'};
print "# Required module `$_' does not appear to be properly installed.\n";
# A silly name for a module (that hopefully won't ever exist).
# Note that this test serves more as a check of the validity of the
# actuall required module tests above.
my $unnecessary = 'bLuRfle';
if (!grep(/$unnecessary/, @extensions)) {
eval " require \"$unnecessary.pm\"; ";
print "## Unnecessary module `$unnecessary' does not appear to be installed.\n" if $opt{'v'};
print "# Unnecessary module `$unnecessary' appears to be installed.\n";
if ($extensions_total == $extensions_there) {
print "## Checking installations of later additional extensions.\n" if $opt{'p'};
my $installed = ExtUtils::Installed -> new();
my @modules = $installed -> modules();
# Consider it there if it contains one or more files,
# and has zero missing files,
# and has a defined version
$version = $installed -> version($_);
print "## $_; $version\n" if $opt{'v'};
print "# $_; NO VERSION\n" if $opt{'v'};
@missing = $installed -> validate($_);
print "# file",+($#missing == 0) ? '' : 's'," missing from installation:\n";
print '# ',join(' ',@missing),"\n";
elsif ($#missing == -1) {
if (($installed_total == $installed_there) &&
($installed_total == $version_check)) {
print "## Checking installations of *.h -> *.ph header files.\n" if $opt{'p'};
# Just about "any" C implementation ought to have a stdio.h (even if
# Config.pm may not list a i_stdio var).
my @ph_files = qw(stdio.ph);
# Add the ones that we know that perl thinks are there:
while (($var, $val) = each %Config) {
if ($var =~ m/i_(.+)/ && $val eq 'define') {
# Some header and symbol names don't match for hysterical raisins.
$h_file = 'arpa/inet' if $h_file eq 'arpainet';
$h_file = 'netinet/in' if $h_file eq 'niin';
$h_file = 'netinet/tcp' if $h_file eq 'netinettcp';
$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';
push(@ph_files, "$h_file.ph");
#foreach (qw(stdio.ph syslog.ph)) {
print "## Perl header `$_' appears to be installed.\n" if $opt{'v'};
print "# Perl header `$_' does not appear to be properly installed.\n";
if (scalar(@ph_files) == $ph_there) {
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
# easier to "fix" - at least for now.
if ($error_total == 0 && $tests_total) {
print "All tests successful.\n";
} elsif ($tests_total==0){
die "FAILED--no tests were run for some reason.\n";
if ($tests_total > 0) { $rate = sprintf "%.2f", 100.0 * ($pass__total / $tests_total); }
printf " %d/%d subtests failed, %.2f%% okay.\n",
$error_total, $tests_total, $rate;
perlivp - Perl Installation Verification Procedure
B<perlivp> [B<-a>] [B<-p>] [B<-v>] [B<-h>]
The B<perlivp> program is set up at Perl source code build time to test the
Perl version it was built under. It can be used after running:
(or your platform's equivalent procedure) to verify that B<perl> and its
libraries have been installed correctly. A correct installation is verified
by output that looks like:
Prints out a brief help message.
=item B<-a> run all tests
Normally tests for optional features are skipped. With -a all tests
=item B<-p> print preface
Gives a description of each test prior to performing it.
Gives more detailed information about each test, after it has been performed.
Note that any failed tests ought to print out some extra information whether
=item * print "# Perl binary `$perlpath' does not appear executable.\n";
Likely to occur for a perl binary that was not properly installed.
Correct by conducting a proper installation.
=item * print "# Perl version `$]' installed, expected $ivp_VERSION.\n";
Likely to occur for a perl that was not properly installed.
Correct by conducting a proper installation.
=item * print "# Perl \@INC directory `$_' does not appear to exist.\n";
Likely to occur for a perl library tree that was not properly installed.
Correct by conducting a proper installation.
=item * print "# Needed module `$_' does not appear to be properly installed.\n";
One of the two modules that is used by perlivp was not present in the
installation. This is a serious error since it adversely affects perlivp's
ability to function. You may be able to correct this by performing a
proper perl installation.
=item * print "# Required module `$_' does not appear to be properly installed.\n";
An attempt to C<eval "require $module"> failed, even though the list of
extensions indicated that it should succeed. Correct by conducting a proper
=item * print "# Unnecessary module `bLuRfle' appears to be installed.\n";
This test not coming out ok could indicate that you have in fact installed
a bLuRfle.pm module or that the C<eval " require \"$module_name.pm\"; ">
test may give misleading results with your installation of perl. If yours
is the latter case then please let the author know.
=item * print "# file",+($#missing == 0) ? '' : 's'," missing from installation:\n";
One or more files turned up missing according to a run of
C<ExtUtils::Installed -E<gt> validate()> over your installation.
Correct by conducting a proper installation.
=item * print "# Perl header `$_' does not appear to be properly installed.\n";
Correct by running B<h2ph> over your system's C header files. If necessary,
edit the resulting *.ph files to eliminate perl syntax errors.
For further information on how to conduct a proper installation consult the
INSTALL file that comes with the perl source and the README file for your