Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
t/800-events.t | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/t/800-events.t b/t/800-events.t
index dfbba8f..b7e767f 100644
--- a/t/800-events.t
+++ b/t/800-events.t
@@ -3,20 +3,24 @@
use strict;
use warnings;
-use Test::More tests => 23;
+use Test::More;
my $URI = "test:///default";
my $DOM = "test";
BEGIN {
- use_ok('Sys::Virt');
+ eval 'use Time::HiRes qw(gettimeofday)';
+ if ($@) {
+ plan skip_all => "Time::HiRes is not available";
+ return;
+ }
+ plan tests => 23;
+ use_ok('Sys::Virt');
}
package Sys::Virt::Event::Simple;
-use Time::HiRes qw(gettimeofday);
-
use base qw(Sys::Virt::Event);
sub new {
@@ -38,7 +42,7 @@ sub new {
sub _now {
my $self;
- my @now = gettimeofday;
+ my @now = &Time::HiRes::gettimeofday();
return $now[0] * 1000 + (($now[1] - ($now[1] % 1000)) / 1000);
}
--
2.23.0