From nobody Wed May 1 21:35:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578493367; cv=none; d=zohomail.com; s=zohoarc; b=gy0vDup6kKR8NJAs1MyZ5+htxzgYfAgtZV4g/8tgv3SoHlp86GZyVm5g/bROypJjpVtW/DE/MQZtFsdG7EutrETunFL7UOZQoVNQijsY6Euwhlb/cZs2VELJMDXQ55wJi4byn+e2zysR38ge2pikxAWD/eUE5vIEA2qqGEMyAO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578493367; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CHK/MQcFdLKtYrnnCJFHOMejMsQv5WX/qYdV0N1Rotk=; b=eCEKNHJJYrfei/ifv0JM6Qq2H6YVb6MoOxrpB9v2tXr1dhv2JjiFsHGYTecsSq/QNXVx9EDFCgIPzuVH66xzLi1Hid3LmjDe8aHso0xWyXRMI4jCRe6TaiHF21n1J0vOoXqtpIqIFAu346HQtikN9DfuXIYqnQZmqL4TIEH1q3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578493367373123.39041033622937; Wed, 8 Jan 2020 06:22:47 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-4mSQ5H0ZOAa5ADLM2-BEMg-1; Wed, 08 Jan 2020 09:22:44 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C12DF800D41; Wed, 8 Jan 2020 14:22:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 547A060BE2; Wed, 8 Jan 2020 14:22:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 13FC918089CD; Wed, 8 Jan 2020 14:22:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 008EMY4Q001707 for ; Wed, 8 Jan 2020 09:22:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id E095B7FB76; Wed, 8 Jan 2020 14:22:34 +0000 (UTC) Received: from dhcp-16-105.lcy.redhat.com (unknown [10.42.16.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F7B89CA3; Wed, 8 Jan 2020 14:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578493366; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CHK/MQcFdLKtYrnnCJFHOMejMsQv5WX/qYdV0N1Rotk=; b=cgzYSXYciCvuaJdXRautz5CXlwiK7d8ITeruJ37s+cuDxI7bbfxE0FMcLGo0+Nx6qIlxkF QEQIwz9lpCHulm7yuLeaxc3gxti6EE3GXqcDFNoC/fnvSFYuWHTrXhQdv6MzMJ7oURzeIj p3UI0YvtZa9aOmhPLgRpdpd4EIk0yHU= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 8 Jan 2020 14:22:30 +0000 Message-Id: <20200108142230.3401097-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [perl PATCH] make Time::HiRes optional in test suite X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 4mSQ5H0ZOAa5ADLM2-BEMg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Fabiano Fid=C3=AAncio --- 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; =20 -use Test::More tests =3D> 23; +use Test::More; =20 my $URI =3D "test:///default"; my $DOM =3D "test"; =20 BEGIN { - use_ok('Sys::Virt'); + eval 'use Time::HiRes qw(gettimeofday)'; + if ($@) { + plan skip_all =3D> "Time::HiRes is not available"; + return; + } + plan tests =3D> 23; + use_ok('Sys::Virt'); } =20 =20 package Sys::Virt::Event::Simple; =20 -use Time::HiRes qw(gettimeofday); - use base qw(Sys::Virt::Event); =20 sub new { @@ -38,7 +42,7 @@ sub new { =20 sub _now { my $self; - my @now =3D gettimeofday; + my @now =3D &Time::HiRes::gettimeofday(); return $now[0] * 1000 + (($now[1] - ($now[1] % 1000)) / 1000); } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list