Autoflush in tests as appropriate
[p5sagit/p5-mst-13.2.git] / t / op / taint.t
index 1e3d396..8ff566e 100755 (executable)
@@ -15,10 +15,14 @@ BEGIN {
 use strict;
 use Config;
 
+$| = 1;
+
 # We do not want the whole taint.t to fail
 # 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 +30,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 +620,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 +658,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);