Change 28508 by [EMAIL PROTECTED] on 2006/07/08 17:28:36
Subject: Skip some POSIX tests when the thing they are testing is
unimplemented
From: demerphq <[EMAIL PROTECTED]>
Date: Sat, 8 Jul 2006 17:55:09 +0200
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/POSIX/t/sysconf.t#3 edit
... //depot/perl/ext/POSIX/t/termios.t#3 edit
Differences ...
==== //depot/perl/ext/POSIX/t/sysconf.t#3 (text) ====
Index: perl/ext/POSIX/t/sysconf.t
--- perl/ext/POSIX/t/sysconf.t#2~28505~ 2006-07-08 02:04:56.000000000 -0700
+++ perl/ext/POSIX/t/sysconf.t 2006-07-08 10:28:36.000000000 -0700
@@ -16,29 +16,36 @@
use POSIX;
use Scalar::Util qw(looks_like_number);
-my @path_consts = qw(
+sub check(@) {
+ grep { eval "&$_;1" or [EMAIL PROTECTED]/vendor has not defined POSIX
macro/ } @_
+}
+
+my @path_consts = check qw(
_PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_NAME_MAX
_PC_NO_TRUNC _PC_PATH_MAX
);
-my @path_consts_terminal = qw(
+my @path_consts_terminal = check qw(
_PC_MAX_CANON _PC_MAX_INPUT _PC_VDISABLE
);
-my @path_consts_fifo = qw(
+my @path_consts_fifo = check qw(
_PC_PIPE_BUF
);
-my @sys_consts = qw(
+my @sys_consts = check qw(
_SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
_SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
_SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
);
-
-plan tests => 2 * 3 * @path_consts +
+my $tests=2 * 3 * @path_consts +
3 * @path_consts_terminal +
2 * 3 * @path_consts_fifo +
3 * @sys_consts;
+plan $tests
+ ? (tests => $tests)
+ : (skip_all => "No tests to run on this OS")
+;
my $curdir = File::Spec->curdir;
@@ -83,7 +90,7 @@
my $fifo = "fifo$$";
SKIP: {
- mkfifo($fifo, 0666)
+ eval { mkfifo($fifo, 0666) }
or skip("could not create fifo $fifo ($!)", 2 * 3 * @path_consts_fifo);
SKIP: {
==== //depot/perl/ext/POSIX/t/termios.t#3 (text) ====
Index: perl/ext/POSIX/t/termios.t
--- perl/ext/POSIX/t/termios.t#2~28505~ 2006-07-08 02:04:56.000000000 -0700
+++ perl/ext/POSIX/t/termios.t 2006-07-08 10:28:36.000000000 -0700
@@ -8,11 +8,17 @@
use Config;
use Test::More;
- plan skip_all => "POSIX is unavailable" if $Config{'extensions'} !~
m!\bPOSIX\b!;
+ plan skip_all => "POSIX is unavailable"
+ if $Config{'extensions'} !~ m!\bPOSIX\b!;
}
-
use strict;
use POSIX;
+BEGIN {
+ plan skip_all => "POSIX::Termios not implemented"
+ if !eval "POSIX::Termios->new;1"
+ and [EMAIL PROTECTED]/not implemented/;
+}
+
my @getters = qw(getcflag getiflag getispeed getlflag getoflag getospeed);
End of Patch.