summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/op/ipcmsg.t21
-rwxr-xr-xt/op/ipcsem.t24
2 files changed, 29 insertions, 16 deletions
diff --git a/t/op/ipcmsg.t b/t/op/ipcmsg.t
index 0fb9726df2..52fb1a27a0 100755
--- a/t/op/ipcmsg.t
+++ b/t/op/ipcmsg.t
@@ -30,12 +30,15 @@ BEGIN {
print "1..0\n";
exit;
}
+
+ use strict;
+
my @incpath = (split(/\s+/, $Config{usrinc}), split(/\s+/ ,$Config{locincpth}));
my %done = ();
my %define = ();
sub process_file {
- my($file) = @_;
+ my($file,$level) = @_;
return unless defined $file;
@@ -52,15 +55,18 @@ BEGIN {
$done{$path} = 1;
unless(defined $path) {
- warn "Cannot find '$file'";
+ warn "Cannot find '$file'" if $level == 0;
return;
}
+ local *F;
+
open(F,$path) or return;
+ $level = 0 unless defined $level;
while(<F>) {
s#/\*.*(\*/|$)##;
- process_file($mm,$1)
+ process_file($1,$level+1)
if /^#\s*include\s*[<"]([^>"]+)[>"]/;
s/(?:\([^)]*\)\s*)//;
@@ -75,7 +81,7 @@ BEGIN {
process_file("sys/ipc.h");
process_file("sys/stat.h");
- foreach $d (@define) {
+ foreach my $d (@define) {
while(defined($define{$d}) && $define{$d} !~ /^(0x)?\d+$/) {
$define{$d} = exists $define{$define{$d}}
? $define{$define{$d}} : undef;
@@ -83,8 +89,11 @@ BEGIN {
unless(defined $define{$d}) {
print "1..0\n";
exit;
- };
- ${ $d } = eval $define{$d};
+ }
+ {
+ no strict 'refs';
+ ${ $d } = eval $define{$d};
+ }
}
}
diff --git a/t/op/ipcsem.t b/t/op/ipcsem.t
index 98a2398449..6839466cfb 100755
--- a/t/op/ipcsem.t
+++ b/t/op/ipcsem.t
@@ -30,12 +30,15 @@ BEGIN {
print "1..0\n";
exit;
}
+
+ use strict;
+
my @incpath = (split(/\s+/, $Config{usrinc}), split(/\s+/ ,$Config{locincpth}));
my %done = ();
my %define = ();
sub process_file {
- my($file) = @_;
+ my($file, $level) = @_;
return unless defined $file;
@@ -52,15 +55,18 @@ BEGIN {
$done{$path} = 1;
unless(defined $path) {
- warn "Cannot find '$file'";
+ warn "Cannot find '$file'" if $level == 0;
return;
}
+ local *F;
+
open(F,$path) or return;
+ $level = 0 unless defined $level;
while(<F>) {
s#/\*.*(\*/|$)##;
- process_file($mm,$1)
+ process_file($1,$level+1)
if /^#\s*include\s*[<"]([^>"]+)[>"]/;
s/(?:\([^)]*\)\s*)//;
@@ -75,7 +81,7 @@ BEGIN {
process_file("sys/ipc.h");
process_file("sys/stat.h");
- foreach $d (@define) {
+ foreach my $d (@define) {
while(defined($define{$d}) && $define{$d} !~ /^(0x)?\d+$/) {
$define{$d} = exists $define{$define{$d}}
? $define{$define{$d}} : undef;
@@ -84,17 +90,15 @@ BEGIN {
print "1..0\n";
exit;
};
- ${ $d } = eval $define{$d};
+ {
+ no strict 'refs';
+ ${ $d } = eval $define{$d};
+ }
}
}
use strict;
-# This test doesn't seem to work properly yet so skip it for _65
-print "1..0\n";
-exit;
-
-
print "1..10\n";
my $sem = semget($IPC_PRIVATE, 10, $S_IRWXU | $S_IRWXG | $S_IRWXO | $IPC_CREAT)