aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-20 03:48:32 +0000
committerYang Tse <yangsita@gmail.com>2009-12-20 03:48:32 +0000
commitf912f8d5d22ab9ceaef77b5e7f6666f286401782 (patch)
tree41cca8b46bf7f428658e0a06bda20bea12d321e6 /tests
parentaf7a5b297f78ebf5ef7519898fdf01f942002f1a (diff)
- Attempt to fix script compilation failure on versions older than 5.007003,
corelist -a Time::HiRes lists this as the first version released with it. - Ensure ftp check delay timer is always an integral number.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index ef483535b..770ffadcf 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -59,8 +59,9 @@
BEGIN {
@INC=(@INC, $ENV{'srcdir'}, ".");
# run time statistics needs perl 5.7 or newer
- if($] >= 5.007) {
- use Time::HiRes qw( time );
+ if($] >= 5.007003) {
+ require Time::HiRes;
+ import Time::HiRes qw( time );
}
}
@@ -644,7 +645,7 @@ sub verifyftp {
}
# we can/should use the time it took to verify the FTP server as a measure
# on how fast/slow this host/FTP is.
- my $took = time()-$time;
+ my $took = int(0.5+time()-$time);
if($verbose) {
logmsg "RUN: Verifying our test ". uc($proto) .
@@ -2950,7 +2951,7 @@ while(@ARGV) {
}
elsif($ARGV[0] eq "-r") {
# run time statistics needs perl 5.7 or newer
- if($] >= 5.007) {
+ if($] >= 5.007003) {
keys(%timeprepini) = 1000;
keys(%timesrvrini) = 1000;
keys(%timesrvrend) = 1000;
@@ -2964,7 +2965,7 @@ while(@ARGV) {
}
elsif($ARGV[0] eq "-rf") {
# run time statistics needs perl 5.7 or newer
- if($] >= 5.007) {
+ if($] >= 5.007003) {
keys(%timeprepini) = 1000;
keys(%timesrvrini) = 1000;
keys(%timesrvrend) = 1000;