From patchwork Thu Mar 21 19:55:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160819 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192555jan; Thu, 21 Mar 2019 12:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNIHyJA87pAhHxznvZ0Jl06lMsh8qNjbzDJdM92c0o4Ar5uBkMKQOLsRPZFKxgeH2kR2tm X-Received: by 2002:a0c:8693:: with SMTP id 19mr4798653qvf.73.1553198128267; Thu, 21 Mar 2019 12:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198128; cv=none; d=google.com; s=arc-20160816; b=aMEt81xT4vRZhddK1GaBW52HPFy7DNnNLMqt4xBF0ETnAcn/xY8JLGyKJFgLLPZsjW pTiCe44B6KHCs81s1nUBdGUKQuAnUtpcy3sqQXAsJu7mNCyF5bCeRbLqnJrMRwvbYOEa exjTzrHexmWTJokzWBuHilvL2qM8XufaPbg+JzbanLyPJSEQ+qgZuEoIEI6eGTWXPjpm dNeDfCMesWS3zSg+z/YkiXb6kF9SRkx5HH/KGARu9md4GgiqfngpoB6fJLN/lM583l6r 3SJ1DZJw4f4SHzPlDPPxen+Wx0WyEKsvLl3Tt3kpCaSl6CxjxvCH6DPmQwNvf6oQkjZQ gltw== 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 :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=FmQRjBW98AB1S//+IXl1rsY2O2i2EHNc++se2+k0w40=; b=pOHgXqBcVassaCvVjgdyI1jnZA6BEsXXHZPT3SKRYbgVWzgOYxa5OTiKiCN4E5HBFV qe2xmMg7MVOQ7NTPyig6dbAaEHftnzeHkfIcU9sewezzjJIbk9EaL9T8gUFVbwJJlVIX X4jAGVWl1yGEB/g1gyUIhMe1ISoyW8dBhopPxGqBzb0zHCRbY4RpRV/SdecsLUQ5nfOT MpWOIPO3JQSHeDPUCuqCMAwA53H5N1D/DyIPQI2XcyCQnF9TW+vEwztmSzRDWl1Ns/1n /+kj6Fj50Yu99C77UevsyukrRENVM7YFwIKWhJHJaA3wPFcWc6/bOCVY+mb7XrIEkwPs dZlw== 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 e189si943953qkb.27.2019.03.21.12.55.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:28 -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-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93BEA308339A; Thu, 21 Mar 2019 19:55:26 +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 641F51001DC1; Thu, 21 Mar 2019 19:55:26 +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 239423FB14; Thu, 21 Mar 2019 19:55:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtIFw020724 for ; Thu, 21 Mar 2019 15:55:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 354DE4124; Thu, 21 Mar 2019 19:55:18 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B76374108; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:06 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v2 4/4] tests: qemuxml2argv: add DO_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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 21 Mar 2019 19:55:27 +0000 (UTC) Base macro to unify the actual testCompareXMLToArgv test calls Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 34394181c1..4b05b4e846 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -866,23 +866,27 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ +# define DO_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, ...) \ + DO_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) @@ -907,19 +911,8 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR) -# 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, ...) \ + DO_TEST_INTERNAL(name, "", __VA_ARGS__, QEMU_CAPS_LAST) /* All the following macros require an explicit QEMU_CAPS_* list * at the end of the argument list, or the NONE placeholder.