chdir 't' if -d 't';
@INC = qw(. ../lib);
-
- require Config; import Config;
require 'test.pl';
}
+require Config; import Config;
+
+$TEST_COUNT = 11;
+
if ($Config{'extensions'} !~ /\bIPC\/SysV\b/) {
skip_all('IPC::SysV was not built');
}
skip_all('$Config{d_msg} undefined');
}
else {
- plan( tests => 11 );
+ plan( tests => $TEST_COUNT );
}
use IPC::SysV qw(
);
use IPC::Semaphore;
+SKIP: {
+
my $sem =
IPC::Semaphore->new(IPC_PRIVATE, 10, S_IRWXU | S_IRWXG | S_IRWXO | IPC_CREAT);
if (!$sem) {
if ($! eq 'No space left on device') {
# "normal" error
- diag("Bail out! cannot acquire a semaphore: $!");
- exit(1);
+ skip( "cannot proceed: IPC::Semaphore->new() said: $!", $TEST_COUNT);
}
else {
# unexpected error
- die "semget: ",$!+0," $!\n";
+ die "IPC::Semaphore->new(): ",$!+0," $!\n";
}
}
ok($sem->remove,'release');
}
}
+
+} # SKIP