From: Jarkko Hietaniemi Date: Tue, 9 Jan 2001 22:45:40 +0000 (+0000) Subject: Allow the locale test needing POSIX and the taint test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9f931b868379618cf79b68035f0c4b7583e1cac;p=p5sagit%2Fp5-mst-13.2.git Allow the locale test needing POSIX and the taint test needing IPC::SysV to run under 'minitest' (basically, bail out if loading the extension fails) p4raw-id: //depot/perl@8384 --- diff --git a/t/op/misc.t b/t/op/misc.t index 63ef2b2..59045bc 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -570,11 +570,14 @@ aba\ba\b # the bug depends on in the internal state of the locale # settings and pragma/locale messes up that state pretty badly. # We need a "fresh run". +BEGIN { + eval { require POSIX }; + if ($@) { + exit(0); # running minitest? + } +} use Config; my $have_setlocale = $Config{d_setlocale} eq 'define'; -eval { - require POSIX; -}; $have_setlocale = 0 if $@; # Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1" # and mingw32 uses said silly CRT diff --git a/t/op/taint.t b/t/op/taint.t index 1e3d396..2958a37 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -19,6 +19,8 @@ use Config; # just because Errno possibly failing. eval { require Errno; import Errno }; +use vars qw($ipcsysv); # did we manage to load IPC::SysV? + BEGIN { if ($^O eq 'VMS' && !defined($Config{d_setenv})) { $ENV{PATH} = $ENV{PATH}; @@ -26,8 +28,11 @@ BEGIN { } if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ && ($Config{d_shm} || $Config{d_msg})) { - require IPC::SysV; - IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU)); + eval { require IPC::SysV }; + unless ($@) { + $ipcsysv++; + IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU)); + } } } @@ -613,6 +618,10 @@ else { # test shmread { + unless ($ipcsysv) { + print "ok 150 # skipped: no IPC::SysV\n"; + last; + } if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ && $Config{d_shm}) { no strict 'subs'; my $sent = "foobar"; @@ -647,6 +656,10 @@ else { # test msgrcv { + unless ($ipcsysv) { + print "ok 151 # skipped: no IPC::SysV\n"; + last; + } if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ && $Config{d_msg}) { no strict 'subs'; my $id = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU);