From patchwork Thu Mar 14 14:44:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160356 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15596066jad; Thu, 14 Mar 2019 07:45:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtBho2q3AHXLeJn1gVSQNDsCgKu2yag+6Jdmhyj8fClKvwKqkcFlmP2+ilP1lBrS7OjT0g X-Received: by 2002:aed:3579:: with SMTP id b54mr26486368qte.248.1552574741150; Thu, 14 Mar 2019 07:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574741; cv=none; d=google.com; s=arc-20160816; b=VnqdRQmbiKmJZMd3G1mqV05ZE8oeIGsodQfUHETm+m2NQ1fJaYCWlSCAfw1KuUVfJT AEHjJB6AryM6py1Rk+T4q1uMDAOoPfQtBQtlD+z2+3olAEvNlpJ4VMRxWLilFX7DyChb +Pbgw50rrRyVyGvXrEU7/3r93EIFs0XJMh6+KLMh24F1AyDGf+7tj73GBf2SiNdar/zI s+hKu8q2BMXF3BjXDSsZCq0Hf5K3F1Fyvcs28SYYqaRg+YxL7dWoKQV6xGi1EaCpF/Rz CcZ9tJBnKEGfISIIj49tRlebgcBP6QXeAX75cJnwNdAPO7Ad28by2OhQSYSlx08SY+sb CQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=xScnbVNNEdINewpnwb4yKtSeiNuXt191a4dGuEQxGo4=; b=h5czCM/7KXKXCKxaQzr4YYD4kBVscNNsa/NjsUUV9lWMmsAKITeeEPm4yNBNle6QwL nEi/JIPg1ONdy28TVbJQN9uqBX+ACx6BtpDYlltDwXg6ZYBk7ZcvfvvSVFZDSIknCGbJ +l+P+6j11rNpIEKfuZCMFKNoMUqfstxgyVQVo0nstpDOsv+jHVLREr1X1uSzXoTZg9Sm 2c68tJpRC+MA/FqzmXrV6BEvjTf6do9f4gDrT1U/FCzUvMxv2OSnpj6TukPZB74VUCix PSQtEy8n2+NVPdD416vafBce9aQn9b+fhOlaWKIJNU165pkuA12mimIZzrtgj9qmexnS RVYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id y143si5539812qky.152.2019.03.14.07.45.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7A9D2588F; Thu, 14 Mar 2019 14:45:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 752725D73F; Thu, 14 Mar 2019 14:45:39 +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 32D2E3D396; Thu, 14 Mar 2019 14:45:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2EEjcBH025075 for ; Thu, 14 Mar 2019 10:45:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 670EE60FE6; Thu, 14 Mar 2019 14:45:38 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-177.rdu2.redhat.com [10.10.124.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C657619BE; Thu, 14 Mar 2019 14:45:29 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:14 -0400 Message-Id: <32ac0ed1c8062c3cf0dc52f1c326d0495ce389c0.1552574299.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/21] tests: qemuxml2argv: add TEST_INTERNAL 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Mar 2019 14:45:40 +0000 (UTC) Base macro to unify the actual testCompareXMLToArgv test calls Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d5e02c26d8..a901582ef6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -842,23 +842,27 @@ mymain(void) * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ +# define TEST_INTERNAL(_name, _suffix, ...) \ do { \ static struct testInfo info = { \ .name = _name, \ - .suffix = "." arch "-" ver, \ + .suffix = _suffix, \ }; \ if (testInfoSetArgs(&info, capslatest, \ - ARG_CAPS_ARCH, arch, \ - ARG_CAPS_VER, ver, \ __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ + if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ testInfoClear(&info); \ } while (0) +# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ + TEST_INTERNAL(name, "." arch "-" ver, \ + ARG_CAPS_ARCH, arch, \ + ARG_CAPS_VER, ver, \ + __VA_ARGS__) + # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) @@ -885,19 +889,8 @@ mymain(void) /* All the following macros require an explicit QEMU_CAPS_* list * at the end of the argument list, or the NONE placeholder */ -# define DO_TEST_FULL(_name, ...) \ - do { \ - static struct testInfo info = { \ - .name = _name, \ - }; \ - if (testInfoSetArgs(&info, capslatest, \ - __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ - return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name, \ - testCompareXMLToArgv, &info) < 0) \ - ret = -1; \ - testInfoClear(&info); \ - } while (0) +# define DO_TEST_FULL(name, ...) \ + TEST_INTERNAL(name, "", __VA_ARGS__, QEMU_CAPS_LAST) # define DO_TEST(name, ...) \ DO_TEST_FULL(name, \