From: Jarkko Hietaniemi Date: Sun, 15 Apr 2001 23:31:46 +0000 (+0000) Subject: Printing out the ok messages helps successful testing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0e172911d4da2e72124db457593beb934daca235;p=p5sagit%2Fp5-mst-13.2.git Printing out the ok messages helps successful testing. p4raw-id: //depot/perl@9714 --- diff --git a/t/lib/time-hires.t b/t/lib/time-hires.t index b74375b..cc741e7 100644 --- a/t/lib/time-hires.t +++ b/t/lib/time-hires.t @@ -161,7 +161,7 @@ unless (defined &Time::HiRes::gettimeofday $SIG{ALRM} = "tick"; while ($i) { - alarm(2.5); + alarm(0.3); select (undef, undef, undef, 10); print "# Select returned! $i ", Time::HiRes::tv_interval ($r), "\n"; } @@ -181,7 +181,7 @@ unless (defined &Time::HiRes::setitimer && exists &Time::HiRes::ITIMER_VIRTUAL && $Config{d_select}) { for (18..19) { - print "ok $_ # skipped\n"; + print "ok $_ # Skip: no virtual interval timers\n"; } } else { use Time::HiRes qw (setitimer getitimer ITIMER_VIRTUAL); @@ -194,7 +194,11 @@ unless (defined &Time::HiRes::setitimer print "# Tick! $i ", Time::HiRes::tv_interval($r), "\n"; }; - print "# setitimer: ", join(" ", setitimer(ITIMER_VIRTUAL, 1, 0.5)), "\n"; + print "# setitimer: ", join(" ", setitimer(ITIMER_VIRTUAL, 0.5, 0.4)), "\n"; + + # Assume interval timer granularity of 0.05 seconds. Too bold? + print "not " unless abs(getitimer(ITIMER_VIRTUAL) / 0.5) - 1 < 0.1; + print "ok 18\n"; print "# getitimer: ", join(" ", getitimer(ITIMER_VIRTUAL)), "\n"; @@ -204,6 +208,9 @@ unless (defined &Time::HiRes::setitimer print "# getitimer: ", join(" ", getitimer(ITIMER_VIRTUAL)), "\n"; + print "not " unless getitimer(ITIMER_VIRTUAL) == 0; + print "ok 19\n"; + $SIG{VTALRM} = 'DEFAULT'; }