From: Jarkko Hietaniemi Date: Mon, 25 Jun 2001 23:32:05 +0000 (+0000) Subject: MPE/iX test tweaks from Mark Bixby. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9ff6e92c701cadc4c6b6acd410567ed1197d416;p=p5sagit%2Fp5-mst-13.2.git MPE/iX test tweaks from Mark Bixby. p4raw-id: //depot/perl@10942 --- diff --git a/ext/POSIX/POSIX.t b/ext/POSIX/POSIX.t index 5bb6ab1..aae4cf3 100755 --- a/ext/POSIX/POSIX.t +++ b/ext/POSIX/POSIX.t @@ -20,6 +20,7 @@ print "1..29\n"; $Is_W32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; $Is_Dos = $^O eq 'dos'; +$Is_MPE = $^O eq 'mpeix'; $testfd = open("TEST", O_RDONLY, 0) and print "ok 1\n"; read($testfd, $buffer, 9) if $testfd > 2; @@ -72,7 +73,11 @@ sub SigINT { } } -print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n"; +if ($Is_MPE) { + print "ok 12 # skipped, _POSIX_OPEN_MAX is inaccurate on MPE\n" +} else { + print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n" +} print getcwd() =~ m#/t$# ? "ok 13\n" : "not ok 13\n"; diff --git a/ext/Storable/t/lock.t b/ext/Storable/t/lock.t index 77d73bb..becaec3 100644 --- a/ext/Storable/t/lock.t +++ b/ext/Storable/t/lock.t @@ -28,6 +28,10 @@ sub BEGIN { print "1..0 # Skip: Storable was not built\n"; exit 0; } + if ($^O eq 'mpeix') { + print "1..0 # Skip: truncate missing on MPE\n"; + exit 0; + } require 'lib/st-dump.pl'; } diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index db35b95..95f1a08 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -18,6 +18,7 @@ use strict; my $have_gettimeofday = defined &Time::HiRes::gettimeofday; my $have_usleep = defined &Time::HiRes::usleep; my $have_ualarm = defined &Time::HiRes::ualarm; +my $have_time = defined &Time::HiRes::time; import Time::HiRes 'gettimeofday' if $have_gettimeofday; import Time::HiRes 'usleep' if $have_usleep; @@ -54,7 +55,7 @@ else { ok 4, ($two[0] > $one[0] || ($two[0] == $one[0] && $two[1] > $one[1])), "@two is not greater than @one"; - my $f = Time::HiRes::time; + my $f = Time::HiRes::time(); ok 5, $f > 850_000_000, "$f too small"; ok 6, $f - $two[0] < 2, "$f - @two >= 2"; } @@ -74,9 +75,9 @@ else { skip 8; } else { - my $f = Time::HiRes::time; + my $f = Time::HiRes::time(); usleep(500_000); - my $f2 = Time::HiRes::time; + my $f2 = Time::HiRes::time(); my $d = $f2 - $f; ok 8, $d > 0.4 && $d < 0.8, "slept $d secs $f to $f2"; } @@ -97,7 +98,7 @@ else { ok 10, $f < 2, $f; } -if (!$have_usleep) { +if (!$have_usleep || !$have_gettimeofday) { skip 11; } else { @@ -129,7 +130,9 @@ else { # new test: did we even get close? -{ +if (!$have_time) { + skip 14 +} else { my $t = time(); my $tf = Time::HiRes::time(); ok 14, (abs($tf - $t) <= 1), @@ -152,11 +155,11 @@ unless (defined &Time::HiRes::gettimeofday print "$f\nok 15\n"; print "# sleep..."; - $r = [Time::HiRes::gettimeofday]; + $r = [Time::HiRes::gettimeofday()]; sleep (0.5); print Time::HiRes::tv_interval($r), "\nok 16\n"; - $r = [Time::HiRes::gettimeofday]; + $r = [Time::HiRes::gettimeofday()]; $i = 5; $SIG{ALRM} = "tick"; while ($i) @@ -187,7 +190,7 @@ unless (defined &Time::HiRes::setitimer use Time::HiRes qw (setitimer getitimer ITIMER_VIRTUAL); my $i = 3; - my $r = [Time::HiRes::gettimeofday]; + my $r = [Time::HiRes::gettimeofday()]; $SIG{VTALRM} = sub { $i ? $i-- : setitimer(ITIMER_VIRTUAL, 0); diff --git a/t/io/fs.t b/t/io/fs.t index 2a14377..3ecfe7f 100755 --- a/t/io/fs.t +++ b/t/io/fs.t @@ -10,7 +10,8 @@ BEGIN { use Config; $Is_Dosish = ($^O eq 'MSWin32' or $^O eq 'NetWare' or $^O eq 'dos' or - $^O eq 'os2' or $^O eq 'mint' or $^O eq 'cygwin'); + $^O eq 'os2' or $^O eq 'mint' or $^O eq 'cygwin' or + $^O eq 'mpeix'); if (defined &Win32::IsWinNT && Win32::IsWinNT()) { $Is_Dosish = '' if Win32::FsType() eq 'NTFS'; diff --git a/t/op/stat.t b/t/op/stat.t index 7a2690c..20dbd90 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -15,6 +15,7 @@ $Is_MSWin32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; $Is_Dos = $^O eq 'dos'; $Is_Cygwin = $^O eq 'cygwin'; +$Is_MPE = $^O eq 'mpeix'; $Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32 || $Is_NetWare || $Is_Cygwin; chop($cwd = (($Is_MSWin32 || $Is_NetWare) ? `cd` : `pwd`)); @@ -53,7 +54,7 @@ if (open(FOO, ">Op.stat.tmp")) { print "# open failed: $!\nnot ok 1\nnot ok 2\n"; } -if ($Is_Dosish) { unlink "Op.stat.tmp2"} +if ($Is_Dosish || $Is_MPE) { unlink "Op.stat.tmp2"} else { `rm -f Op.stat.tmp2;ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`; } @@ -61,13 +62,13 @@ else { ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat('Op.stat.tmp'); -if ($Is_Dosish || $Config{dont_use_nlink}) +if ($Is_Dosish || $Is_MPE || $Config{dont_use_nlink}) {print "ok 3 # skipped: no link count\n";} elsif ($nlink == 2) {print "ok 3\n";} else {print "# \$nlink is |$nlink|\nnot ok 3\n";} -if ( $Is_Dosish +if ( $Is_Dosish || $Is_MPE # Solaris tmpfs bug || ($cwd =~ m#^/tmp# and $mtime && $mtime==$ctime && $^O eq 'solaris') || $cwd =~ m#$Config{'afsroot'}/# @@ -172,7 +173,7 @@ else {print "not ok 33\n";} if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";} -if ($^O eq 'mpeix' or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) { +if ($Is_MPE or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) { print "ok 35 # skipped: no -u\n"; goto tty_test; }