From nobody Sat Apr 27 14:11:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536058909115961.6167171875479; Tue, 4 Sep 2018 04:01:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DED9308338E; Tue, 4 Sep 2018 11:01:47 +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 C57BD308BDA2; Tue, 4 Sep 2018 11:01:45 +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 5046F1800540; Tue, 4 Sep 2018 11:01:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w84B1fRU011728 for ; Tue, 4 Sep 2018 07:01:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42C0EA9EBB; Tue, 4 Sep 2018 11:01:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8671DA30A6; Tue, 4 Sep 2018 11:01:38 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 4 Sep 2018 12:01:10 +0100 Message-Id: <20180904110110.13591-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: skip qemublocktest if building without YAJL 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 04 Sep 2018 11:01:47 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 If no JSON parser is available qemublocktest fails, so skip its execution. Signed-off-by: Daniel P. Berrang=C3=A9 --- Pushed as a build fix for platforms without JSON parser installed tests/qemublocktest.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 0c335abc5b..8e8773e6a8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -19,17 +19,19 @@ #include =20 #include "testutils.h" -#include "testutilsqemu.h" -#include "testutilsqemuschema.h" -#include "virstoragefile.h" -#include "virstring.h" -#include "virlog.h" -#include "qemu/qemu_block.h" -#include "qemu/qemu_qapi.h" =20 -#include "qemu/qemu_command.h" +#if WITH_YAJL +# include "testutilsqemu.h" +# include "testutilsqemuschema.h" +# include "virstoragefile.h" +# include "virstring.h" +# include "virlog.h" +# include "qemu/qemu_block.h" +# include "qemu/qemu_qapi.h" =20 -#define VIR_FROM_THIS VIR_FROM_NONE +# include "qemu/qemu_command.h" + +# define VIR_FROM_THIS VIR_FROM_NONE =20 VIR_LOG_INIT("tests.storagetest"); =20 @@ -355,7 +357,7 @@ mymain(void) =20 virTestCounterReset("qemu storage source xml->json->xml "); =20 -#define TEST_JSON_FORMAT(tpe, xmlstr) \ +# define TEST_JSON_FORMAT(tpe, xmlstr) \ do { \ xmljsonxmldata.type =3D tpe; \ xmljsonxmldata.xml =3D xmlstr; \ @@ -364,7 +366,7 @@ mymain(void) ret =3D -1; \ } while (0) =20 -#define TEST_JSON_FORMAT_NET(xmlstr)\ +# define TEST_JSON_FORMAT_NET(xmlstr) \ TEST_JSON_FORMAT(VIR_STORAGE_TYPE_NETWORK, xmlstr) =20 TEST_JSON_FORMAT(VIR_STORAGE_TYPE_FILE, "\n"); @@ -417,7 +419,7 @@ mymain(void) " \n" "\n"); =20 -#define TEST_DISK_TO_JSON_FULL(nme, fl) \ +# define TEST_DISK_TO_JSON_FULL(nme, fl) \ do { \ diskxmljsondata.name =3D nme; \ diskxmljsondata.props =3D NULL; \ @@ -435,7 +437,7 @@ mymain(void) testQemuDiskXMLToPropsClear(&diskxmljsondata); \ } while (0) =20 -#define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false) +# define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false) =20 if (!(diskxmljsondata.schema =3D testQEMUSchemaLoad())) { ret =3D -1; @@ -500,4 +502,12 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 +#else +static int +mymain(void) +{ + return EXIT_AM_SKIP; +} +#endif + VIR_TEST_MAIN(mymain) --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list